for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Kunstmaan\AdminListBundle\Tests\AdminList\BulkAction;
use Kunstmaan\AdminListBundle\AdminList\BulkAction\SimpleBulkAction;
use PHPUnit\Framework\TestCase;
class SimpleBulkActionTest extends TestCase
{
/**
* @var SimpleBulkAction
*/
protected $object;
protected function setUp()
$this->object = new SimpleBulkAction(['https://cia.gov'], 'CIA', 'fa-check', 'some.twig');
}
public function testGetters()
$this->assertCount(1, $this->object->getUrl());
$this->object->getUrl()
array
object<Countable>|object...nit\Framework\iterable>
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
$this->assertEquals('https://cia.gov', $this->object->getUrl()[0]);
$this->assertEquals('CIA', $this->object->getLabel());
$this->assertEquals('fa-check', $this->object->getIcon());
$this->assertEquals('some.twig', $this->object->getTemplate());
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: