|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace Rector\PHPUnit\Tests\CodeQuality\Rector\Class_\InlineStubPropertyToCreateStubMethodCallRector\Fixture; |
| 4 | + |
| 5 | +use PHPUnit\Framework\TestCase; |
| 6 | +use PHPUnit\Framework\MockObject\Stub; |
| 7 | +use Rector\PHPUnit\Tests\CodeQuality\Rector\Class_\InlineStubPropertyToCreateStubMethodCallRector\Source\NotRelevantClass; |
| 8 | + |
| 9 | +final class HandleArrayItem extends TestCase |
| 10 | +{ |
| 11 | + private Stub $someStub; |
| 12 | + |
| 13 | + protected function setUp(): void |
| 14 | + { |
| 15 | + $this->someStub = $this->createStub(NotRelevantClass::class); |
| 16 | + } |
| 17 | + |
| 18 | + public function testAnother() |
| 19 | + { |
| 20 | + $anotherObject = new NotRelevantClass($this->someStub); |
| 21 | + } |
| 22 | + |
| 23 | + public function testArrayItems() |
| 24 | + { |
| 25 | + $anotherObject = $this->getMockBuilder(NotRelevantClass::class) |
| 26 | + ->setConstructorArgs([$this->someStub]); |
| 27 | + } |
| 28 | +} |
| 29 | + |
| 30 | +?> |
| 31 | +----- |
| 32 | +<?php |
| 33 | + |
| 34 | +namespace Rector\PHPUnit\Tests\CodeQuality\Rector\Class_\InlineStubPropertyToCreateStubMethodCallRector\Fixture; |
| 35 | + |
| 36 | +use PHPUnit\Framework\TestCase; |
| 37 | +use PHPUnit\Framework\MockObject\Stub; |
| 38 | +use Rector\PHPUnit\Tests\CodeQuality\Rector\Class_\InlineStubPropertyToCreateStubMethodCallRector\Source\NotRelevantClass; |
| 39 | + |
| 40 | +final class HandleArrayItem extends TestCase |
| 41 | +{ |
| 42 | + protected function setUp(): void |
| 43 | + { |
| 44 | + } |
| 45 | + |
| 46 | + public function testAnother() |
| 47 | + { |
| 48 | + $anotherObject = new NotRelevantClass($this->createStub(\Rector\PHPUnit\Tests\CodeQuality\Rector\Class_\InlineStubPropertyToCreateStubMethodCallRector\Source\NotRelevantClass::class)); |
| 49 | + } |
| 50 | + |
| 51 | + public function testArrayItems() |
| 52 | + { |
| 53 | + $anotherObject = $this->getMockBuilder(NotRelevantClass::class) |
| 54 | + ->setConstructorArgs([$this->createStub(\Rector\PHPUnit\Tests\CodeQuality\Rector\Class_\InlineStubPropertyToCreateStubMethodCallRector\Source\NotRelevantClass::class)]); |
| 55 | + } |
| 56 | +} |
| 57 | + |
| 58 | +?> |
0 commit comments