Skip to content

Commit 20d2bc8

Browse files
committed
add assert fixture
1 parent 82d18f1 commit 20d2bc8

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
namespace Rector\PHPUnit\Tests\CodeQuality\Rector\ClassMethod\BareCreateMockAssignToDirectUseRector\Fixture;
4+
5+
use PHPUnit\Framework\TestCase;
6+
use Rector\PHPUnit\Tests\CodeQuality\Rector\ClassMethod\BareCreateMockAssignToDirectUseRector\Source\AnotherClass;
7+
8+
final class SkipIfAssert extends TestCase
9+
{
10+
public function test()
11+
{
12+
$someMock = $this->createMock(AnotherClass::class);
13+
14+
$anotherClass = new AnotherClass(1, 2, 3, $someMock);
15+
16+
$this->assertSame($someMock, $anotherClass->getSomeMock());
17+
}
18+
}

rules-tests/CodeQuality/Rector/ClassMethod/BareCreateMockAssignToDirectUseRector/Source/AnotherClass.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@
66

77
final class AnotherClass
88
{
9-
public function __construct(...$various)
9+
public function __construct($one, $two, $three, private $someMock)
1010
{
1111

1212
}
13+
14+
public function getSomeMock()
15+
{
16+
return $this->someMock;
17+
}
1318
}

0 commit comments

Comments
 (0)