for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Robo\Collection\CollectionBuilder;
class ForEachCest {
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
public function setIterableWithDeferTaskConfiguration(CliGuy $I)
{
$I->wantTo('set iterable with deferTaskConfiguration()');
$expected = [
'a = b',
'c = d',
'e = f',
];
$actual = [];
$I
->collectionBuilder()
->addCode(function (\Robo\State\Data $data) {
$data['items'] = [
'a' => 'b',
'c' => 'd',
'e' => 'f',
return 0;
})
->addTask(
->taskForEach()
->deferTaskConfiguration('setIterable', 'items')
->withBuilder(function (CollectionBuilder $builder, $key, $value) use (&$actual) {
$builder->addCode(function () use ($key, $value, &$actual) {
$actual[] = "$key = $value";
});
)
->run();
$I->assertEquals($expected, $actual);
}
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.