Skip to content

Commit

Permalink
#82 - Move Di::reset() into setUp() method
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeckerson committed Jan 16, 2020
1 parent 4e4197b commit 84d79ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions tests/functional/Forms/ProductTypesFormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@

final class ProductTypesFormTest extends Unit
{
public function setUp(): void
{
Di::reset();
}

public function inputDataProvider(): array
{
$key = 'name';
Expand All @@ -30,8 +35,6 @@ public function inputDataProvider(): array
*/
public function testValidation(array $data, bool $expected): void
{
Di::reset();

$di = new Di();
$di['filter'] = function () {
return new Filter();
Expand Down
5 changes: 4 additions & 1 deletion tests/functional/Models/ContactTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@

final class ContactTest extends Unit
{
public function testBeforeCreate(): void
public function setUp(): void
{
Di::reset();
}

public function testBeforeCreate(): void
{
$di = new Di();
$di['modelsManager'] = function () {
return new Manager();
Expand Down

0 comments on commit 84d79ab

Please sign in to comment.