for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Created by PhpStorm.
* User: polidog
* Date: 2017/02/22.
*/
namespace Polidog\SsrBundle\Tests\Render;
use Koriym\Baracoa\BaracoaInterface;
use PHPUnit\Framework\TestCase;
use Polidog\SsrBundle\Annotations\Ssr;
use Polidog\SsrBundle\Render\SsrRender;
use Prophecy\Argument;
class SsrRenderTest extends TestCase
{
public function testRender()
$app = 'index_ssr';
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
$a = "a"; $ab = "ab"; $abc = "abc";
will produce issues in the first and second line, while this second example
will produce no issues.
$meta = ['title'];
$state = ['hello'];
$parameters = [
'title' => 'hogehoge',
'hello' => [
'name' => 'polidog',
],
];
$baracoa = $this->prophesize(BaracoaInterface::class);
$baracoa->render(Argument::any(), Argument::any(), Argument::any())
->willReturn('string');
$ssr = new Ssr([]);
$ssr->setApp($app);
$ssr->setMetas($meta);
$ssr->setState($state);
$ssrRender = new SsrRender($baracoa->reveal());
$ssrRender->render($ssr, $parameters);
$baracoa->render(
$ssr->getApp(),
['hello' => ['name' => 'polidog']],
['title' => 'hogehoge']
)->shouldHaveBeenCalled();
}
This check marks files that end in a newline character, i.e. an empy line.
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.