-
-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #962 from JonPurvis/construct-destruct-expectations
add toHaveConstructor() and toHaveDestructor() expectations
- Loading branch information
Showing
8 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
test('class has constructor') | ||
->expect('Tests\Fixtures\Arch\ToHaveConstructor\HasConstructor\HasConstructor') | ||
->toHaveConstructor(); | ||
|
||
test('class has no constructor') | ||
->expect('Tests\Fixtures\Arch\ToHaveConstructor\HasNoConstructor\HasNoConstructor') | ||
->not->toHaveConstructor(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
test('class has destructor') | ||
->expect('Tests\Fixtures\Arch\ToHaveDestructor\HasDestructor\HasDestructor') | ||
->toHaveDestructor(); | ||
|
||
test('class has no destructor') | ||
->expect('Tests\Fixtures\Arch\ToHaveDestructor\HasNoDestructor\HasNoDestructor') | ||
->not->toHaveDestructor(); |
13 changes: 13 additions & 0 deletions
13
tests/Fixtures/Arch/ToHaveConstructor/HasConstructor/HasConstructor.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tests\Fixtures\Arch\ToHaveConstructor\HasConstructor; | ||
|
||
class HasConstructor | ||
{ | ||
public function __construct() | ||
{ | ||
|
||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
tests/Fixtures/Arch/ToHaveConstructor/HasNoConstructor/HasNoConstructor.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tests\Fixtures\Arch\ToHaveConstructor\HasNoConstructor; | ||
|
||
class HasNoConstructor | ||
{ | ||
} |
13 changes: 13 additions & 0 deletions
13
tests/Fixtures/Arch/ToHaveDestructor/HasDestructor/HasDestructor.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tests\Fixtures\Arch\ToHaveDestructor\HasDestructor; | ||
|
||
class HasDestructor | ||
{ | ||
public function __destruct() | ||
{ | ||
|
||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
tests/Fixtures/Arch/ToHaveDestructor/HasNoDestructor/HasNoDestructor.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tests\Fixtures\Arch\ToHaveDestructor\HasNoDestructor; | ||
|
||
class HasNoDestructor | ||
{ | ||
} |