Skip to content

Commit 7edb410

Browse files
committed
add test fixture for #51
1 parent 2641a25 commit 7edb410

File tree

3 files changed

+51
-9
lines changed

3 files changed

+51
-9
lines changed

composer.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,13 @@
1616
"symfony/console": "^7.1"
1717
},
1818
"require-dev": {
19-
"rector/rector": "dev-main",
20-
"nikic/php-parser": "^5.3.1",
21-
"phpunit/phpunit": "^10.5",
22-
"phpstan/phpstan": "^2.0",
23-
"symplify/easy-coding-standard": "^12.1",
19+
"rector/rector": "^2.0",
20+
"nikic/php-parser": "^5.4",
21+
"phpunit/phpunit": "^11.5",
22+
"phpstan/phpstan": "^2.1",
23+
"phpecs/phpecs": "^2.0",
2424
"phpstan/extension-installer": "^1.3",
25-
"symplify/rule-doc-generator": "^12.1",
26-
"tomasvotruba/class-leak": "^0.2.5",
25+
"tomasvotruba/class-leak": "^2.0",
2726
"tracy/tracy": "^2.10"
2827
},
2928
"autoload": {
@@ -47,7 +46,7 @@
4746
"phpstan": "vendor/bin/phpstan analyse --ansi",
4847
"check-cs": "vendor/bin/ecs check --ansi",
4948
"fix-cs": "vendor/bin/ecs check --fix --ansi",
50-
"docs": "vendor/bin/rule-doc-generator generate src rules --output-file docs/rector_rules_overview.md --ansi"
49+
"phpunit": "vendor/bin/phpunit --colors=always"
5150
},
5251
"minimum-stability": "dev",
5352
"prefer-stable": true,

src/NodeFactory/WillReturnMapMethodCallFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ private function createConsecutiveItemsArray(
9393
PhpSpecMethodName::SHOULD_RETURN
9494
);
9595

96-
if (empty($returnArgs)) {
96+
if ($returnArgs === []) {
9797
$returnArgs = $this->resolveInputArgs(
9898
$consecutiveMethodCall->getMethodCall(),
9999
PhpSpecMethodName::WILL_RETURN
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
namespace spec\Set\Sylius;
4+
5+
use PhpSpec\ObjectBehavior;
6+
7+
final class SomeTestedClassSpec extends ObjectBehavior
8+
{
9+
public function it_is_initializable(): void
10+
{
11+
$this->shouldHaveType(SomeTestedClass::class);
12+
}
13+
14+
public function it_implements(): void
15+
{
16+
$this->shouldImplement(RandomInterface::class);
17+
}
18+
}
19+
20+
?>
21+
-----
22+
<?php
23+
24+
namespace Tests\Set\Sylius;
25+
26+
use PhpSpec\ObjectBehavior;
27+
28+
final class SomeTestedClassTest extends \PHPUnit\Framework\TestCase
29+
{
30+
private SomeTestedClass $someTestedClass;
31+
32+
protected function setUp(): void
33+
{
34+
$this->someTestedClass = new SomeTestedClass();
35+
}
36+
37+
public function testImplements(): void
38+
{
39+
$this->assertInstanceOf(RandomInterface::class, $this->someTestedClass);
40+
}
41+
}
42+
43+
?>

0 commit comments

Comments
 (0)