for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Tests\AppBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class DefaultControllerTest extends WebTestCase
{
public function testIndex()
exec('./bin/console d:d:c --env=test');
exec('./bin/console d:s:c --env=test');
exec('./bin/console h:f:l -n --env=test');
$client = static::createClient();
$crawler = $client->request('GET', '/login');
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertCount(3, $crawler->filter('input'));
}
public function testUpdatePassword()
$crawler = $client->request('GET', '/password_update/2');
$this->assertEquals('200', $client->getResponse()->getStatusCode());
$form = $crawler->selectButton('Submit')->form();
$form['reset_password[plainPassword][first]'] = 'new';
$form['reset_password[plainPassword][second]'] = 'new';
$client->submit($form);
$form
array<string,string,{"re...rd][second]":"string"}>
object<Symfony\Component\DomCrawler\Form>
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);
exec('./bin/console d:d:d --force --env=test');
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: