diff --git a/storage/database/.gitignore b/application/storage/database/.gitignore similarity index 100% rename from storage/database/.gitignore rename to application/storage/database/.gitignore diff --git a/laravel/bootstrap/core.php b/laravel/bootstrap/core.php index 64823780..fe8b27ef 100644 --- a/laravel/bootstrap/core.php +++ b/laravel/bootstrap/core.php @@ -12,9 +12,9 @@ define('APP_PATH', realpath($application).'/'); define('BASE_PATH', realpath("$laravel/..").'/'); define('PUBLIC_PATH', realpath($public).'/'); -define('STORAGE_PATH', realpath($storage).'/'); define('SYS_PATH', realpath($laravel).'/'); +define('STORAGE_PATH', APP_PATH.'storage/'); define('CACHE_PATH', STORAGE_PATH.'cache/'); define('CONFIG_PATH', APP_PATH.'config/'); define('CONTROLLER_PATH', APP_PATH.'controllers/'); @@ -42,7 +42,7 @@ define('ENV_CONFIG_PATH', $environment); -unset($application, $public, $storage, $laravel, $environment); +unset($application, $public, $laravel, $environment); /** * Require all of the classes that can't be loaded by the auto-loader. diff --git a/public/index.php b/public/index.php index 033593fc..8de2a6c9 100644 --- a/public/index.php +++ b/public/index.php @@ -8,34 +8,22 @@ * @link http://laravel.com */ -/* -|-------------------------------------------------------------------------- -| Tick... Tock... Tick... Tock -|-------------------------------------------------------------------------- -*/ - -define('START_TIME', microtime(true)); - -/* -|-------------------------------------------------------------------------- -| Laravel Installation Paths -|-------------------------------------------------------------------------- -*/ - +// -------------------------------------------------------------- +// The path to the application directory. +// -------------------------------------------------------------- $application = '../application'; +// -------------------------------------------------------------- +// The path to the Laravel directory. +// -------------------------------------------------------------- $laravel = '../laravel'; -$storage = '../storage'; - +// -------------------------------------------------------------- +// The path to the public directory. +// -------------------------------------------------------------- $public = __DIR__; -/* -|-------------------------------------------------------------------------- -| 3... 2... 1... Lift-off! -|-------------------------------------------------------------------------- -*/ - -require $laravel.'/laravel.php'; - -echo number_format((microtime(true) - START_TIME) * 1000, 2); \ No newline at end of file +// -------------------------------------------------------------- +// Launch Laravel. +// -------------------------------------------------------------- +require $laravel.'/laravel.php'; \ No newline at end of file diff --git a/storage/cache/.gitignore b/storage/cache/.gitignore deleted file mode 100644 index f59ec20a..00000000 --- a/storage/cache/.gitignore +++ /dev/null @@ -1 +0,0 @@ -* \ No newline at end of file diff --git a/storage/sessions/.gitignore b/storage/sessions/.gitignore deleted file mode 100644 index f59ec20a..00000000 --- a/storage/sessions/.gitignore +++ /dev/null @@ -1 +0,0 @@ -* \ No newline at end of file diff --git a/storage/views/.gitignore b/storage/views/.gitignore deleted file mode 100644 index f59ec20a..00000000 --- a/storage/views/.gitignore +++ /dev/null @@ -1 +0,0 @@ -* \ No newline at end of file diff --git a/tests/Cases/ArrTest.php b/tests/Cases/ArrTest.php deleted file mode 100644 index f9d43226..00000000 --- a/tests/Cases/ArrTest.php +++ /dev/null @@ -1,68 +0,0 @@ -assertEquals(Arr::get($array, 'email'), $array['email']); - $this->assertEquals(Arr::get($array, 'names.uncle'), $array['names']['uncle']); - } - - /** - * @dataProvider getArray - */ - public function test_get_method_returns_default_when_item_doesnt_exist($array) - { - $this->assertNull(Arr::get($array, 'names.aunt')); - $this->assertEquals(Arr::get($array, 'names.aunt', 'Tammy'), 'Tammy'); - $this->assertEquals(Arr::get($array, 'names.aunt', function() {return 'Tammy';}), 'Tammy'); - } - - /** - * @dataProvider getArray - */ - public function test_set_method_sets_items_in_array($array) - { - Arr::set($array, 'name', 'Taylor'); - Arr::set($array, 'names.aunt', 'Tammy'); - Arr::set($array, 'names.friends.best', 'Abigail'); - $this->assertEquals($array['name'], 'Taylor'); - $this->assertEquals($array['names']['aunt'], 'Tammy'); - $this->assertEquals($array['names']['friends']['best'], 'Abigail'); - } - - /** - * @dataProvider getArray - */ - public function test_first_method_returns_first_item_passing_truth_test($array) - { - $array['email2'] = 'taylor@hotmail.com'; - $this->assertEquals('taylorotwell@gmail.com', Arr::first($array, function($k, $v) {return substr($v, 0, 3) == 'tay';})); - } - - /** - * @dataProvider getArray - */ - public function test_first_method_returns_default_when_no_matching_item_is_found($array) - { - $this->assertNull(Arr::first($array, function($k, $v) {return $v === 'something';})); - $this->assertEquals('default', Arr::first($array, function($k, $v) {return $v === 'something';}, 'default')); - $this->assertEquals('default', Arr::first($array, function($k, $v) {return $v === 'something';}, function() {return 'default';})); - } - - public function getArray() - { - return array(array( - array( - 'email' => 'taylorotwell@gmail.com', - 'names' => array( - 'uncle' => 'Mike', - ), - ) - )); - } - -} \ No newline at end of file diff --git a/tests/Cases/ConfigTest.php b/tests/Cases/ConfigTest.php deleted file mode 100644 index b502466f..00000000 --- a/tests/Cases/ConfigTest.php +++ /dev/null @@ -1,41 +0,0 @@ -assertTrue(Config::has('hasvalue')); - } - - public function test_has_method_returns_false_when_item_doesnt_exist() - { - $this->assertFalse(Config::has('something')); - } - - public function test_config_get_can_retrieve_item_from_configuration() - { - $this->assertTrue(is_array(Config::get('application'))); - $this->assertEquals(Config::get('application.url'), 'http://localhost'); - } - - public function test_get_method_returns_default_when_requested_item_doesnt_exist() - { - $this->assertNull(Config::get('config.item')); - $this->assertEquals(Config::get('config.item', 'test'), 'test'); - $this->assertEquals(Config::get('config.item', function() {return 'test';}), 'test'); - } - - public function test_config_set_can_set_configuration_items() - { - Config::set('application.names.test', 'test'); - Config::set('application.url', 'test'); - Config::set('session', array()); - Config::set('test', array()); - $this->assertEquals(Config::get('application.names.test'), 'test'); - $this->assertEquals(Config::get('application.url'), 'test'); - $this->assertEquals(Config::get('session'), array()); - $this->assertEquals(Config::get('test'), array()); - } - -} \ No newline at end of file diff --git a/tests/Cases/LangTest.php b/tests/Cases/LangTest.php deleted file mode 100644 index cdbb6ca0..00000000 --- a/tests/Cases/LangTest.php +++ /dev/null @@ -1,28 +0,0 @@ -assertEquals($language['required'], Lang::line('validation.required')->get()); - } - - public function test_default_value_is_returned_when_line_doesnt_exist() - { - $language = require LANG_PATH.'en/validation.php'; - - $this->assertEquals('Taylor', Lang::line('validation.something')->get(null, 'Taylor')); - } - - public function test_replacements_can_be_made_on_language_lines() - { - $language = require LANG_PATH.'en/validation.php'; - - $expect = str_replace(':attribute', 'E-Mail', $language['required']); - - $this->assertEquals($expect, Lang::line('validation.required', array('attribute' => 'E-Mail'))->get()); - } - -} \ No newline at end of file diff --git a/tests/Cases/RequestTest.php b/tests/Cases/RequestTest.php deleted file mode 100644 index d23e8448..00000000 --- a/tests/Cases/RequestTest.php +++ /dev/null @@ -1,103 +0,0 @@ -assertEquals($expectation, Laravel\Request::uri()); - } - - public function test_request_method_returns_spoofed_method_if_uri_is_spoofed() - { - $_POST = array(Laravel\Request::spoofer => 'something'); - $this->assertEquals('something', Laravel\Request::method()); - } - - public function test_request_method_returns_request_method_from_server_array() - { - $_SERVER['REQUEST_METHOD'] = 'PUT'; - $this->assertEquals('PUT', Laravel\Request::method()); - } - - public function test_server_method_returns_from_the_server_array() - { - $_SERVER = array('TEST' => 'something', 'USER' => array('NAME' => 'taylor')); - $this->assertEquals('something', Laravel\Request::server('test')); - $this->assertEquals('taylor', Laravel\Request::server('user.name')); - } - - public function test_spoofed_returns_true_when_request_is_spoofed() - { - $_POST[Laravel\Request::spoofer] = 'something'; - $this->assertTrue(Laravel\Request::spoofed()); - } - - public function test_spoofed_returns_false_when_request_isnt_spoofed() - { - $this->assertFalse(Laravel\Request::spoofed()); - } - - public function test_ip_method_returns_client_ip_address() - { - $_SERVER['REMOTE_ADDR'] = 'something'; - $this->assertEquals('something', Laravel\Request::ip()); - - $_SERVER['HTTP_CLIENT_IP'] = 'something'; - $this->assertEquals('something', Laravel\Request::ip()); - - $_SERVER['HTTP_X_FORWARDED_FOR'] = 'something'; - $this->assertEquals('something', Laravel\Request::ip()); - - $_SERVER = array(); - $this->assertEquals('0.0.0.0', Laravel\Request::ip()); - } - - public function test_protocol_returns_server_protocol() - { - $_SERVER['SERVER_PROTOCOL'] = 'taylor'; - $this->assertEquals('taylor', Laravel\Request::protocol()); - - unset($_SERVER['SERVER_PROTOCOL']); - $this->assertEquals('HTTP/1.1', Laravel\Request::protocol()); - } - - public function test_ajax_method_returns_false_when_not_ajax() - { - $this->assertFalse(Laravel\Request::ajax()); - } - - public function test_ajax_method_returns_true_when_ajax() - { - $_SERVER['HTTP_X_REQUESTED_WITH'] = 'xmlhttprequest'; - $this->assertTrue(Laravel\Request::ajax()); - } - - public function requestUriProvider() - { - return array( - array('/index.php', '/'), - array('/index.php/', '/'), - array('http://localhost/user', 'user'), - array('http://localhost/user/', 'user'), - array('http://localhost/index.php', '/'), - array('http://localhost/index.php/', '/'), - array('http://localhost/index.php//', '/'), - array('http://localhost/index.php/user', 'user'), - array('http://localhost/index.php/user/', 'user'), - array('http://localhost/index.php/user/profile', 'user/profile'), - ); - } - -} \ No newline at end of file diff --git a/tests/Cases/Routing/RouteFilterTest.php b/tests/Cases/Routing/RouteFilterTest.php deleted file mode 100644 index f8311729..00000000 --- a/tests/Cases/Routing/RouteFilterTest.php +++ /dev/null @@ -1,48 +0,0 @@ - function() - { - return 'simple'; - }, - - 'parameters' => function($one, $two, $three = null) - { - return $one.'|'.$two.'|'.$three; - }, - ); - - Filter::register($filters); - - $this->assertEquals(Filter::run(array('simple'), array(), true), 'simple'); - $this->assertEquals(Filter::run(array('parameters:1,2'), array(), true), '1|2|'); - $this->assertEquals(Filter::run(array('parameters:1,2'), array(3), true), '3|1|2'); - } - - public function test_after_filters_are_called() - { - $filters = array( - 'after1' => function() - { - define('ROUTE_FILTER_AFTER_1', 1); - }, - - 'after2' => function() - { - define('ROUTE_FILTER_AFTER_2', 2); - }, - ); - - Filter::register($filters); - - Filter::run(array('after1', 'after2')); - - $this->assertTrue(defined('ROUTE_FILTER_AFTER_1')); - $this->assertTrue(defined('ROUTE_FILTER_AFTER_2')); - } - -} \ No newline at end of file diff --git a/tests/Cases/Routing/RouteLoaderTest.php b/tests/Cases/Routing/RouteLoaderTest.php deleted file mode 100644 index 4dae5d37..00000000 --- a/tests/Cases/Routing/RouteLoaderTest.php +++ /dev/null @@ -1,53 +0,0 @@ -getLoader(); - - $routes = $loader->load('/'); - - $this->assertEquals(count($routes), 2); - $this->assertTrue(array_key_exists('GET /', $routes)); - $this->assertTrue(array_key_exists('GET /root', $routes)); - } - - public function test_loader_can_load_single_nested_routes() - { - $loader = $this->getLoader(); - - $routes = $loader->load('user'); - - $this->assertEquals(count($routes), 4); - $this->assertTrue(array_key_exists('GET /user', $routes)); - $this->assertTrue(array_key_exists('GET /user/profile', $routes)); - } - - public function test_loader_can_load_multi_nested_routes() - { - $loader = $this->getLoader(); - - $routes = $loader->load('admin/panel'); - - $this->assertEquals(count($routes), 4); - $this->assertTrue(array_key_exists('GET /admin/panel/show', $routes)); - $this->assertTrue(array_key_exists('GET /admin/panel/update', $routes)); - } - - public function test_everything_loads_all_routes() - { - $loader = $this->getLoader(); - - $routes = $loader->everything(); - - $this->assertEquals(count($routes), 6); - - } - - private function getLoader() - { - return new Loader(FIXTURE_PATH.'RouteLoader/', FIXTURE_PATH.'RouteLoader/routes/'); - } - -} diff --git a/tests/Cases/Session/SessionManagerTest.php b/tests/Cases/Session/SessionManagerTest.php deleted file mode 100644 index b340d5c4..00000000 --- a/tests/Cases/Session/SessionManagerTest.php +++ /dev/null @@ -1,350 +0,0 @@ -expects($this->once())->method('get'); - - Manager::start($driver, $transporter); - } - - /** - * @dataProvider mockProvider - */ - public function test_session_manager_calls_driver_load_with_session_id($driver, $transporter) - { - $transporter->expects($this->any()) - ->method('get') - ->will($this->returnValue('something')); - - $driver->expects($this->once()) - ->method('load') - ->with($this->equalTo('something')); - - Manager::start($driver, $transporter); - } - - /** - * @dataProvider mockProvider - */ - public function test_session_manager_returns_payload_when_found($driver, $transporter) - { - $this->setDriverExpectation($driver, 'load', $this->getDummySession()); - - Manager::start($driver, $transporter); - - $this->assertEquals(Manager::$session, $this->getDummySession()); - } - - /** - * @dataProvider mockProvider - */ - public function test_session_manager_creates_new_session_when_session_is_null($driver, $transporter) - { - $this->setDriverExpectation($driver, 'load', null); - - Manager::start($driver, $transporter); - - $this->assertTrue(is_array(Manager::$session['data'])); - $this->assertEquals(strlen(Manager::$session['id']), 40); - } - - /** - * @dataProvider mockProvider - */ - public function test_session_manager_creates_new_session_when_session_is_expired($driver, $transporter) - { - $dateTime = new DateTime('1970-01-01'); - - $this->setDriverExpectation($driver, 'load', array('last_activity' => $dateTime->getTimestamp())); - - Manager::start($driver, $transporter); - - $this->assertEquals(strlen(Manager::$session['id']), 40); - } - - /** - * @dataProvider mockProvider - */ - public function test_session_manager_sets_csrf_token_if_one_is_not_present($driver, $transporter) - { - $session = $this->getDummySession(); - unset($session['data']['csrf_token']); - - $this->setDriverExpectation($driver, 'load', $session); - - Manager::start($driver, $transporter); - - $this->assertTrue(isset(Manager::$session['data']['csrf_token'])); - $this->assertEquals(strlen(Manager::$session['data']['csrf_token']), 16); - } - - /** - * @dataProvider mockProvider - */ - public function test_close_method_calls_driver_and_transporter($driver, $transporter) - { - $driver->expects($this->any()) - ->method('load') - ->will($this->returnValue($this->getDummySession())); - - Manager::start($driver, $transporter); - - $driver->expects($this->once()) - ->method('save'); - - $transporter->expects($this->once()) - ->method('put'); - - Manager::close($driver, $transporter); - } - - /** - * @dataProvider mockProvider - */ - public function test_close_method_calls_sweep_when_driver_is_sweeper($driver, $transporter) - { - $driver = $this->getMock('SweeperStub', array('sweep')); - - $driver->expects($this->once())->method('sweep'); - - Manager::start($driver, $transporter); - - Config::$items['session']['sweepage'] = array(100, 100); - - Manager::close($driver, $transporter); - } - - /** - * @dataProvider mockProvider - */ - public function test_close_method_doesnt_call_sweep_when_driver_isnt_sweeper($driver, $transporter) - { - $driver = $this->getMock('Laravel\\Session\\Drivers\\Driver', array('sweep', 'load', 'save', 'delete')); - - $driver->expects($this->never())->method('sweep'); - - Manager::start($driver, $transporter); - - Config::$items['session']['sweepage'] = array(100, 100); - - Manager::close($driver, $transporter); - } - - public function test_has_method_indicates_if_item_exists_in_payload() - { - Manager::$session = $this->getDummyData(); - - $this->assertTrue(Manager::has('name')); - $this->assertTrue(Manager::has('age')); - $this->assertTrue(Manager::has('gender')); - $this->assertFalse(Manager::has('something')); - $this->assertFalse(Manager::has('id')); - $this->assertFalse(Manager::has('last_activity')); - } - - public function test_get_method_returns_item_from_payload() - { - Manager::$session = $this->getDummyData(); - - $this->assertEquals(Manager::get('name'), 'Taylor'); - $this->assertEquals(Manager::get('age'), 25); - $this->assertEquals(Manager::get('gender'), 'male'); - } - - public function test_get_method_returns_default_when_item_doesnt_exist() - { - Manager::$session = $this->getDummyData(); - - $this->assertNull(Manager::get('something')); - $this->assertEquals('Taylor', Manager::get('something', 'Taylor')); - $this->assertEquals('Taylor', Manager::get('something', function() {return 'Taylor';})); - } - - public function test_put_method_adds_to_payload() - { - Manager::$session = $this->getDummyData(); - - Manager::put('name', 'Weldon'); - Manager::put('workmate', 'Joe'); - - $this->assertEquals(Manager::$session['data']['name'], 'Weldon'); - $this->assertEquals(Manager::$session['data']['workmate'], 'Joe'); - } - - public function test_flash_method_puts_item_in_flash_data() - { - Manager::$session = array(); - - Manager::flash('name', 'Taylor'); - - $this->assertEquals(Manager::$session['data'][':new:name'], 'Taylor'); - } - - public function test_reflash_keeps_all_session_data() - { - Manager::$session = array('data' => array(':old:name' => 'Taylor', ':old:age' => 25)); - - Manager::reflash(); - - $this->assertTrue(isset(Manager::$session['data'][':new:name'])); - $this->assertTrue(isset(Manager::$session['data'][':new:age'])); - $this->assertFalse(isset(Manager::$session['data'][':old:name'])); - $this->assertFalse(isset(Manager::$session['data'][':old:age'])); - } - - public function test_keep_method_keeps_specified_session_data() - { - Manager::$session = array('data' => array(':old:name' => 'Taylor', ':old:age' => 25)); - - Manager::keep('name'); - - $this->assertTrue(isset(Manager::$session['data'][':new:name'])); - $this->assertFalse(isset(Manager::$session['data'][':old:name'])); - - Manager::$session = array('data' => array(':old:name' => 'Taylor', ':old:age' => 25)); - - Manager::keep(array('name', 'age')); - - $this->assertTrue(isset(Manager::$session['data'][':new:name'])); - $this->assertTrue(isset(Manager::$session['data'][':new:age'])); - $this->assertFalse(isset(Manager::$session['data'][':old:name'])); - $this->assertFalse(isset(Manager::$session['data'][':old:age'])); - } - - public function test_flush_method_clears_payload_data() - { - Manager::$session = array('data' => array('name' => 'Taylor')); - - Manager::flush(); - - $this->assertEquals(count(Manager::$session['data']), 0); - } - - public function test_regenerate_session_sets_new_session_id() - { - Manager::$session = array('id' => 'something'); - - Manager::regenerate(); - - $this->assertTrue(Manager::$regenerated); - $this->assertEquals(strlen(Manager::$session['id']), 40); - } - - public function test_age_method_sets_last_activity_time() - { - $data = $this->getDummyData(); - unset($data['last_activity']); - - Manager::$session = $data; - Manager::age(); - - $this->assertTrue(isset(Manager::$session['last_activity'])); - } - - public function test_age_method_ages_all_flash_data() - { - Manager::$session = $this->getDummyData(); - - Manager::age(); - - $this->assertTrue(isset(Manager::$session['data'][':old:age'])); - $this->assertFalse(isset(Manager::$session['data'][':old:gender'])); - } - - public function test_age_method_returns_session_array() - { - Manager::$session = $this->getDummyData(); - - $age = Manager::age(); - - $this->assertEquals($age['id'], 'something'); - } - - // --------------------------------------------------------------------- - // Support Functions - // --------------------------------------------------------------------- - - public function getDummyData() - { - return array('id' => 'something', 'last_activity' => time(), 'data' => array( - 'name' => 'Taylor', - ':new:age' => 25, - ':old:gender' => 'male', - 'state' => 'Oregon', - )); - } - - // --------------------------------------------------------------------- - // Providers - // --------------------------------------------------------------------- - - public function mockProvider() - { - return array(array($this->getMockDriver(), $this->getMockTransporter())); - } - - // --------------------------------------------------------------------- - // Support Functions - // --------------------------------------------------------------------- - - private function setDriverExpectation($mock, $method, $session) - { - $mock->expects($this->any()) - ->method($method) - ->will($this->returnValue($session)); - } - - private function getMockDriver() - { - return $this->getMock('Laravel\\Session\\Drivers\\Driver'); - } - - private function getMockTransporter() - { - return $this->getMock('Laravel\\Session\\Transporters\\Transporter', array('get', 'put')); - } - - private function getDummySession() - { - return array( - 'id' => 'something', - 'last_activity' => time(), - 'data' => array( - 'name' => 'Taylor', - 'csrf_token' => 'token' - )); - } - - private function getConfig() - { - return Config::$items['session']; - } - -} - -// --------------------------------------------------------------------- -// Stubs -// --------------------------------------------------------------------- - -class SweeperStub implements Laravel\Session\Drivers\Driver, Laravel\Session\Drivers\Sweeper { - - public function load($id) {} - public function save($session, $config, $exists) {} - public function delete($id) {} - public function sweep($expiration) {} - -} \ No newline at end of file diff --git a/tests/Cases/StrTest.php b/tests/Cases/StrTest.php deleted file mode 100644 index c31cdee1..00000000 --- a/tests/Cases/StrTest.php +++ /dev/null @@ -1,51 +0,0 @@ -assertEquals('something', Laravel\Str::lower('SomeThing')); - $this->assertEquals('τάχιστη', Laravel\Str::lower('ΤΆΧΙΣΤΗ')); - } - - public function test_upper() - { - $this->assertEquals('SPEAK LOUDER', Laravel\Str::upper('speak louder')); - $this->assertEquals('ΤΆΧΙΣΤΗ', Laravel\Str::upper('Τάχιστη')); - } - - public function test_title() - { - $this->assertEquals('This Is A Test', Laravel\Str::title('this is a test')); - $this->assertEquals('Τάχιστη Τάχιστη', Laravel\Str::title('τάχιστη τάχιστη')); - } - - public function test_length() - { - $this->assertEquals(4, Laravel\Str::length('four')); - $this->assertEquals(7, Laravel\Str::length('τάχιστη')); - } - - public function test_ascii() - { - $this->assertEquals('Deuxieme Article', Laravel\Str::ascii('Deuxième Article')); - } - - public function test_random() - { - $this->assertEquals(5, strlen(Laravel\Str::random(5))); - } - - public function test_limit() - { - $this->assertEquals('Thi...', Laravel\Str::limit('This is a string of text', 3, '...')); - $this->assertEquals('This is ', Laravel\Str::limit('This is a string of text', 7, ' ')); - $this->assertEquals('τάχ', Laravel\Str::limit('τάχιστη', 3, '')); - } - - public function test_limit_words() - { - $this->assertEquals('This is a...', Laravel\Str::words('This is a string of text', 3, '...')); - $this->assertEquals('This is a string ', Laravel\Str::words('This is a string of text', 4, ' ')); - } -} \ No newline at end of file diff --git a/tests/Cases/UrlTest.php b/tests/Cases/UrlTest.php deleted file mode 100644 index 995e5a94..00000000 --- a/tests/Cases/UrlTest.php +++ /dev/null @@ -1,49 +0,0 @@ -assertEquals(URL::to(''), 'http://localhost/index.php/'); - $this->assertEquals(URL::to('something'), 'http://localhost/index.php/something'); - } - - public function test_simple_url_without_index() - { - Config::set('application.index', ''); - - $this->assertEquals(Url::to(''), 'http://localhost/'); - $this->assertEquals(Url::to('something'), 'http://localhost/something'); - - Config::set('application.index', 'index.php'); - } - - public function test_asset_url() - { - $this->assertEquals(URL::to_asset('img/test.jpg'), 'http://localhost/img/test.jpg'); - - Config::set('application.index', ''); - - $this->assertEquals(URL::to_asset('img/test.jpg'), 'http://localhost/img/test.jpg'); - - Config::set('application.index', 'index.php'); - } - - public function test_secure_url() - { - $this->assertEquals(URL::to_secure('something'), 'https://localhost/index.php/something'); - - Config::set('application.ssl', false); - - $this->assertEquals(URL::to_secure('something'), 'http://localhost/index.php/something'); - - Config::set('application.ssl', true); - } - - public function test_slug() - { - $this->assertEquals(URL::slug('My favorite blog!!'), 'my-favorite-blog'); - $this->assertEquals(URL::slug('My favorite blog!!', '_'), 'my_favorite_blog'); - } - -} \ No newline at end of file diff --git a/tests/Cases/ValidatorTest.php b/tests/Cases/ValidatorTest.php deleted file mode 100644 index f7c13881..00000000 --- a/tests/Cases/ValidatorTest.php +++ /dev/null @@ -1,38 +0,0 @@ - 'required|email', - 'password' => 'required|confirmed|min:6', - 'name' => 'required|alpha', - 'age' => 'required', - ); - - $attributes = array( - 'email' => 'taylorotwell', - 'password' => 'something', - 'password_confirmation' => 'something', - 'name' => 'taylor5', - ); - - $messages = array('name_alpha' => 'The name must be alphabetic!'); - - $validator = Validator::make($attributes, $rules, $messages); - - $this->assertFalse($validator->valid()); - $this->assertTrue($validator->errors->has('name')); - $this->assertTrue($validator->errors->has('email')); - $this->assertFalse($validator->errors->has('password')); - $this->assertEquals(count($validator->errors->get('name')), 1); - $this->assertEquals($validator->errors->first('name'), 'The name must be alphabetic!'); - $this->assertEquals($validator->errors->first('email'), Lang::line('validation.email', array('attribute' => 'email'))->get()); - $this->assertEquals($validator->errors->first('age'), Lang::line('validation.required', array('attribute' => 'age'))->get()); - } - -} \ No newline at end of file diff --git a/tests/Fixtures/RouteLoader/routes.php b/tests/Fixtures/RouteLoader/routes.php deleted file mode 100644 index 473f3bd6..00000000 --- a/tests/Fixtures/RouteLoader/routes.php +++ /dev/null @@ -1,15 +0,0 @@ - function() - { - return 'GET /'; - }, - - 'GET /root' => function() - { - return 'GET /root'; - }, - -); \ No newline at end of file diff --git a/tests/Fixtures/RouteLoader/routes/admin/panel.php b/tests/Fixtures/RouteLoader/routes/admin/panel.php deleted file mode 100644 index 4ba3b3c8..00000000 --- a/tests/Fixtures/RouteLoader/routes/admin/panel.php +++ /dev/null @@ -1,15 +0,0 @@ - function() - { - return 'GET /admin/panel/show'; - }, - - 'GET /admin/panel/update' => function() - { - return 'GET /admin/panel/update'; - }, - -); \ No newline at end of file diff --git a/tests/Fixtures/RouteLoader/routes/user.php b/tests/Fixtures/RouteLoader/routes/user.php deleted file mode 100644 index 156b97cf..00000000 --- a/tests/Fixtures/RouteLoader/routes/user.php +++ /dev/null @@ -1,15 +0,0 @@ - function() - { - return 'GET /user'; - }, - - 'GET /user/profile' => function() - { - return 'GET /user/profile'; - }, - -); \ No newline at end of file diff --git a/tests/bootstrap.php b/tests/bootstrap.php deleted file mode 100644 index b594d0b8..00000000 --- a/tests/bootstrap.php +++ /dev/null @@ -1,40 +0,0 @@ - - - - Cases - - - \ No newline at end of file