Make assertSame(200, $response->getStatusCode()) in tests comparing response code to include response contents for faster feedback
use PHPUnit\Framework\TestCase;
class SomeClass extends TestCase
{
public function run()
{
/** @var \Symfony\Component\HttpFoundation\Response $response */
$response = $this->processResult();
- $this->assertSame(200, $response->getStatusCode());
+ $this->assertSame(200, $response->getStatusCode(), $response->getContent());
}
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\Symfony\CodeQuality\Rector\MethodCall\AssertSameResponseCodeWithDebugContentsRector;
return RectorConfig::configure()
->withRules([
AssertSameResponseCodeWithDebugContentsRector::class,
]);