Skip to content

Commit 311b094

Browse files
committed
Simplifying tests thanks to PHPStan's TestCase available as part of src/ directory in dist package
1 parent 9e7e2c7 commit 311b094

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/Reflection/Dibi/DibiFluentClassReflectionExtensionTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@
22

33
namespace PHPStan\Reflection\Dibi;
44

5-
use PHPStan\Reflection\ClassReflection;
6-
7-
class DibiFluentClassReflectionExtensionTest extends \PHPUnit\Framework\TestCase
5+
class DibiFluentClassReflectionExtensionTest extends \PHPStan\Testing\TestCase
86
{
97

8+
/** @var \PHPStan\Broker\Broker */
9+
private $broker;
10+
1011
/** @var \PHPStan\Reflection\Dibi\DibiFluentClassReflectionExtension */
1112
private $extension;
1213

1314
protected function setUp()
1415
{
16+
$this->broker = $this->createBroker();
1517
$this->extension = new DibiFluentClassReflectionExtension();
1618
}
1719

@@ -36,15 +38,13 @@ public function dataHasMethod(): array
3638
*/
3739
public function testHasMethod(string $className, bool $result)
3840
{
39-
$classReflection = $this->createMock(ClassReflection::class);
40-
$classReflection->method('getName')->will($this->returnValue($className));
41+
$classReflection = $this->broker->getClass($className);
4142
$this->assertSame($result, $this->extension->hasMethod($classReflection, 'select'));
4243
}
4344

4445
public function testGetMethod()
4546
{
46-
$classReflection = $this->createMock(ClassReflection::class);
47-
$classReflection->method('getName')->will($this->returnValue(\Dibi\Fluent::class));
47+
$classReflection = $this->broker->getClass(\Dibi\Fluent::class);
4848
$methodReflection = $this->extension->getMethod($classReflection, 'select');
4949
$this->assertSame('select', $methodReflection->getName());
5050
$this->assertSame($classReflection, $methodReflection->getDeclaringClass());

0 commit comments

Comments
 (0)