for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace spec\Slick\Mvc\Http\Renderer;
use Aura\Router\Route;
use Slick\Mvc\Http\Renderer\ViewInflector;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
use Slick\Mvc\Http\Renderer\ViewInflectorInterface;
/**
* ViewInflectorSpec
*
* @package spec\Slick\Mvc\Http\Renderer
* @author Filipe Silva <[email protected]>
*/
class ViewInflectorSpec extends ObjectBehavior
{
function let()
$this->beConstructedWith('tpl');
}
function it_is_initializable()
$this->shouldHaveType(ViewInflector::class);
function its_a_view_inflector()
$this->shouldBeAnInstanceOf(ViewInflectorInterface::class);
function it_inflates_camel_cased_names_to_dashed_names()
$route = new Route();
$route->attributes([
'controller' => 'staticPages',
'action' => 'aboutUs'
]);
$this->inflect($route)->shouldBe('static-pages/about-us.tpl');
function it_inflates_underscored_names_to_dashed_names()
$this->beConstructedWith('html');
'controller' => 'otherPages',
'action' => 'testPage'
$this->inflect($route)->shouldBe('other-pages/test-page.html');