diff --git a/composer.json b/composer.json index b9b4643..9b4987e 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,8 @@ ], "autoload": { "psr-4": { - "LaravelProfane\\": "src/" + "LaravelProfane\\": "src/", + "LaravelProfaneTests\\": "tests/" } }, "minimum-stability": "stable", diff --git a/tests/ProfaneValidatorTest.php b/tests/ProfaneValidatorTest.php index 83ea6d5..9654201 100644 --- a/tests/ProfaneValidatorTest.php +++ b/tests/ProfaneValidatorTest.php @@ -1,22 +1,12 @@ mockConfigs(); - } - public function tearDown() - { - parent::tearDown(); - m::close(); - } - public function test_can_validate_a_word_with_numbers() { $attribute = 'username'; @@ -148,17 +138,4 @@ class ProfaneValidatorTest extends PHPUnit_Framework_TestCase $this->assertFalse($profane->validate($attribute, $text, $parameters)); } - - private function mockConfigs() - { - Config::shouldReceive('get') - ->once() - ->with('app.locale') - ->andReturn('en'); - - Config::shouldReceive('has') - ->once() - ->with('app.locale') - ->andReturn(true); - } } diff --git a/tests/StrTest.php b/tests/StrTest.php index 3e674da..f80a64a 100644 --- a/tests/StrTest.php +++ b/tests/StrTest.php @@ -1,8 +1,11 @@ mockConfigs(); + } + + /** + * [tearDown description] + * @return [type] [description] + */ + public function tearDown() + { + parent::tearDown(); + Mockery::close(); + } + + /** + * [mockConfigs description] + * @return void + */ + protected function mockConfigs() + { + Config::shouldReceive('get') + ->once() + ->with('app.locale') + ->andReturn('en'); + + Config::shouldReceive('has') + ->once() + ->with('app.locale') + ->andReturn(true); + } +}