Skip to content

Commit df08fef

Browse files
authored
Allow to use FQCN when resolving fixtures by name
1 parent d05a3d3 commit df08fef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/FixtureLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function __construct(
2828
* Generally speaking the following options are available:
2929
* - `$dryMode`: If set to true, the fixtures will not be executed (only printed)
3030
* - `$groupName`: If set, only fixtures with the given group name will be executed
31-
* - `$fixtureNames`: If set, only fixtures with the given class name will be executed
31+
* - `$fixtureNames`: If set, only fixtures with the given class name will be executed. Can be the FCQN or just the class base name
3232
* - `$withDependencies`: If set to true, all dependencies of the fixtures will be executed as well
3333
* - `$withVendor`: If set to true, all fixtures found in vendor directory will be executed as well
3434
*/
@@ -84,7 +84,7 @@ static function (Fixture $fixture) use ($option) {
8484
$fqcn = $fixture::class;
8585
$className = substr(strrchr($fqcn, '\\') ?: '', 1);
8686

87-
return \in_array($className, $option->fixtureNames, true);
87+
return \in_array($className, $option->fixtureNames, true) || \in_array($fqcn, $option->fixtureNames, true);
8888
},
8989
);
9090
}

0 commit comments

Comments
 (0)