Skip to content

Commit e1e9e90

Browse files
committed
Use assertions
1 parent 949db82 commit e1e9e90

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

src/StaticMethodMock.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public static function handleStaticCall(string $className, string $method, array
7575
}
7676
$expected = array_shift($mock->expectations);
7777
$mock->testCase->assertEquals($expected['method'], strtoupper($method), sprintf('StaticMethodMock method mismatch for %s::%s', $className, $method));
78+
var_dump([$expected['arguments'], $arguments]);
7879
$mock->testCase->assertEquals($expected['arguments'], $arguments, sprintf('StaticMethodMock arguments mismatch for %s::%s', $className, $method));
7980
if ($expected['exception'] !== null) {
8081
throw $expected['exception'];

tests/StaticMethodMockTest.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,17 @@
33
namespace MintyPHP\Mocking\Tests;
44

55
use MintyPHP\Mocking\StaticMethodMock;
6+
use MintyPHP\Mocking\Tests\Math\Adder;
67
use PHPUnit\Framework\TestCase;
78

8-
class Adder
9-
{
10-
public static function add($a, $b):int
11-
{
12-
return $a+$b;
13-
}
14-
}
15-
169
class StaticMethodMockTest extends TestCase
1710
{
1811
public function testStaticMethodMock(): void
1912
{
2013
// Create a static method mock for the Adder class
2114
$mock = new StaticMethodMock(Adder::class, $this);
2215
// Set expectation for the add method
23-
$mock->expect('add', [1, 2, 3], 3);
16+
$mock->expect('add', [1, 2], 3);
2417
// Call the public static add method
2518
$result = Adder::add(1, 2);
2619
// Verify the result

0 commit comments

Comments
 (0)