diff --git a/.gitignore b/.gitignore index eaf1c55ca9..af9e7c181f 100755 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ public/assets/.siteflow app/config/local/session.php .couscous tests/_support/_generated/* +tests/_data/scenarios diff --git a/.travis.yml b/.travis.yml index ec5c34ef74..f28e63f0a8 100755 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,11 @@ addons: - hosts: - - snipe-it.dev + hosts: + - snipe-it.dev +sudo: false # see http://about.travis-ci.org/docs/user/languages/php/ for more hints language: php -# We don't use sudo here, so we can use travis' upgraded container infrastructure -sudo: false - # list any PHP version you want to test against php: - 5.4 @@ -35,9 +33,17 @@ before_script: # omitting "script:" will default to phpunit # use the $DB env variable to determine the phpunit.xml to use -script: ./vendor/bin/codecept run +# script: ./vendor/bin/codecept run +script: phpunit # configure notifications (email, IRC, campfire etc) notifications: + email: false slack: secure: vv9we1RxB9RsrMbomSdq6D7vz/okobw87pEkgIZjB+hj1QpQ2by90gsPsOa+NgsJEFaEP7e4KlT6SH8kK+zhbmuKaUd3d1//XdcancE22LZXi6tkiB5yuR/Jhhb1LLDqyGJTB4D92hMnnCPiUjpxNA3r437ttNeYRdYIEEP3drA= + webhooks: + urls: + - https://webhooks.gitter.im/e/5e136eb0c1965f3918d0 + on_success: change # options: [always|never|change] default: always + on_failure: change # options: [always|never|change] default: always + on_start: false # default: false diff --git a/app/tests/TestCase.php b/app/tests/TestCase.php index 0b95430f5c..7f9a97b444 100755 --- a/app/tests/TestCase.php +++ b/app/tests/TestCase.php @@ -35,9 +35,8 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase */ private function prepareForTests() { - Artisan::call('migrate', array('--package' => 'cartalyst/sentry','--force'=>true)); - Artisan::call('migrate'); - Mail::pretend(true); + Artisan::call('migrate', array('--package' => 'cartalyst/sentry')); + Artisan::call('migrate'); } } diff --git a/app/tests/UserTest.php b/app/tests/UserTest.php deleted file mode 100644 index b33251020b..0000000000 --- a/app/tests/UserTest.php +++ /dev/null @@ -1,29 +0,0 @@ -email = "name@example.com"; - $user->password = "password"; - $user->password_confirmation = "password"; - - // User should not save - $this->assertFalse($user->save()); - - // Save the errors - $errors = $user->errors()->all(); - - // There should be 1 error - $this->assertCount(1, $errors); - - // The username error should be set - $this->assertEquals($errors[0], "The username field is required."); - } - - -} diff --git a/bootstrap/start.php b/bootstrap/start.php index 364daeaf03..b7862c418d 100755 --- a/bootstrap/start.php +++ b/bootstrap/start.php @@ -25,8 +25,6 @@ $app = new Illuminate\Foundation\Application; */ $env = $app->detectEnvironment(array( - - 'testing' => array('snipe-it.dev','worker-linux-docker-*'), 'local' => array('homestead','AlisonMBP'), 'staging' => array('stagingweb01'), 'production' => array('www.yourserver.com') diff --git a/codeception.yml b/codeception.yml index b953b30faf..cc71ac17d5 100644 --- a/codeception.yml +++ b/codeception.yml @@ -8,24 +8,9 @@ settings: bootstrap: _bootstrap.php colors: true memory_limit: 1024M -coverage: - enabled: false - remote: false - include: - - app/* - exclude: - - app/storage/cache/* - remote_context_options: - http: - timeout: 60 - ssl: - verify_peer: false modules: - enabled: - - Laravel4 - config: Db: - dsn: 'mysql:host=localhost;dbname=snipeit_laravel' + dsn: 'mysql:host=localhost;dbname=snipeit_unit' user: 'travis' password: '' dump: tests/_data/dump.sql diff --git a/tests/acceptance.suite.yml b/tests/acceptance.suite.yml index a7f423970d..7c4f3eb351 100644 --- a/tests/acceptance.suite.yml +++ b/tests/acceptance.suite.yml @@ -9,4 +9,10 @@ modules: enabled: - PhpBrowser: url: http://snipe-it.dev - - \Helper\Acceptance +# Even when filters are set to true, this doesn't seem to work. +# Also, it looks like the Laravel4 module isn't really meant for +# Acceptance tests? +# - Laravel4: +# filters: true +# cleanup: true +# environment: testing diff --git a/tests/functional.suite.yml b/tests/functional.suite.yml index 18317d973c..87c6edd80b 100644 --- a/tests/functional.suite.yml +++ b/tests/functional.suite.yml @@ -6,4 +6,10 @@ class_name: FunctionalTester modules: - enabled: [Filesystem, \Helper\Functional] + enabled: + - Filesystem + - \Helper\Functional + - Laravel4: + filters: true + cleanup: true + environment: testing diff --git a/tests/unit.suite.yml b/tests/unit.suite.yml index aaf619e4f4..913c3e51ec 100644 --- a/tests/unit.suite.yml +++ b/tests/unit.suite.yml @@ -3,4 +3,10 @@ # suite for unit (internal) tests. class_name: UnitTester modules: - enabled: [Asserts, \Helper\Unit] + enabled: + - Asserts + - \Helper\Unit + - Laravel4: + filters: true + cleanup: true + environment: testing diff --git a/tests/unit/UserTest.php b/tests/unit/UserTest.php index 623c512f5e..a5358e4e8f 100644 --- a/tests/unit/UserTest.php +++ b/tests/unit/UserTest.php @@ -12,6 +12,7 @@ class UserTest extends TestCase { $user = new User; $user->email = "name@example.com"; $user->password = "password"; + $user->setHasher(new Cartalyst\Sentry\Hashing\BCryptHasher); // User should not save @@ -29,4 +30,5 @@ class UserTest extends TestCase { */ + }