mardi 7 avril 2015

Laravel 5 testing environment not getting set in Codeception unit tests

I'm using Laravel 5 and Codeception and I would like to use an in-memory SQLite database for my unit tests, however, I can't seem to get my environment set to "testing" in Codeception. I'm using the Laravel5 module and have the following defined in my unit.suite.yml file:



class_name: UnitTester
modules:
enabled: [Asserts, UnitHelper, Laravel5]
config:
Laravel5:
environment_file: .env.testing


I have a .env file which defines all my local settings, then a .env.testing file that defines all the testing-specific settings. However, it never seems to actually set the environment correctly.


To test the environment I just did:



$this->assertEquals('testing', \App::environment());


and I always get:



Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'testing'
+'local'


Anyone have any idea what I'm doing wrong?


Aucun commentaire:

Enregistrer un commentaire