forked from rectorphp/rector-phpunit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfixture.php.inc
More file actions
41 lines (33 loc) · 1.46 KB
/
fixture.php.inc
File metadata and controls
41 lines (33 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
namespace Rector\PHPUnit\Tests\CodeQuality\Rector\MethodCall\AssertInstanceOfComparisonRector\Fixture;
use Rector\PHPUnit\Tests\CodeQuality\Rector\MethodCall\AssertInstanceOfComparisonRector\Fixture\Foo;
final class MyOfComparisonTest extends \PHPUnit\Framework\TestCase
{
public function test()
{
$expectedInstance = Foo::class;
$expectedNamespacedInstance = \Namespaced\Foo::class;
$this->assertTrue($something instanceof Foo);
$this->assertTrue($something instanceof $expectedInstance);
$this->assertTrue($something instanceof $expectedNamespacedInstance);
$this->assertFalse($something instanceof \Namespaced\Foo);
}
}
?>
-----
<?php
namespace Rector\PHPUnit\Tests\CodeQuality\Rector\MethodCall\AssertInstanceOfComparisonRector\Fixture;
use Rector\PHPUnit\Tests\CodeQuality\Rector\MethodCall\AssertInstanceOfComparisonRector\Fixture\Foo;
final class MyOfComparisonTest extends \PHPUnit\Framework\TestCase
{
public function test()
{
$expectedInstance = Foo::class;
$expectedNamespacedInstance = \Namespaced\Foo::class;
$this->assertInstanceOf(\Rector\PHPUnit\Tests\CodeQuality\Rector\MethodCall\AssertInstanceOfComparisonRector\Fixture\Foo::class, $something);
$this->assertInstanceOf($expectedInstance, $something);
$this->assertInstanceOf($expectedNamespacedInstance, $something);
$this->assertNotInstanceOf(\Namespaced\Foo::class, $something);
}
}
?>