Skip to content

Commit

Permalink
stop calling static methods in tests as non-static
Browse files Browse the repository at this point in the history
  • Loading branch information
petrduda committed Mar 9, 2023
1 parent 408c753 commit a5ce432
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/LazyRobotLoaderClassFinderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function testRebuildRobotLoaderOnlyOnFirstRun(): void
->setMethods(['rebuild'])
->getMock();
$robotLoader
->expects($this->once())
->expects(self::once())
->method('rebuild');

$lazyClassFinder = new LazyRobotLoaderClassFinder($robotLoader);
Expand Down
13 changes: 7 additions & 6 deletions tests/RobotLoaderClassFinderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Consistence\ClassFinder\RobotLoader;

use Nette\Loaders\RobotLoader;
use PHPUnit\Framework\Assert;

class RobotLoaderClassFinderTest extends \PHPUnit\Framework\TestCase
{
Expand All @@ -13,8 +14,8 @@ public function testFindClass(): void
{
$classList = array_values($this->getRobotLoaderClassFinder()->findByInterface(ExtendingClass::class));

$this->assertContains(ExtendingClass::class, $classList);
$this->assertCount(1, $classList);
Assert::assertContains(ExtendingClass::class, $classList);
Assert::assertCount(1, $classList);
}

public function testFindClassAndChildren(): void
Expand All @@ -27,15 +28,15 @@ public function testFindClassAndChildren(): void
ExtendingClass::class,
];

$this->assertEquals($expected, $classList);
Assert::assertEquals($expected, $classList);
}

public function testFindInterface(): void
{
$classList = array_values($this->getRobotLoaderClassFinder()->findByInterface(NotImplementedInterface::class));

$this->assertContains(NotImplementedInterface::class, $classList);
$this->assertCount(1, $classList);
Assert::assertContains(NotImplementedInterface::class, $classList);
Assert::assertCount(1, $classList);
}

public function testFindInterfaceAndImplementations(): void
Expand All @@ -50,7 +51,7 @@ public function testFindInterfaceAndImplementations(): void
ExtendingInterface::class,
];

$this->assertEquals($expected, $classList);
Assert::assertEquals($expected, $classList);
}

private function getRobotLoaderClassFinder(): RobotLoaderClassFinder
Expand Down

0 comments on commit a5ce432

Please sign in to comment.