for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
* @copyright Aimeos (aimeos.org), 2015-2016
*/
namespace Aimeos\MW\View\Engine;
class BladeTest extends \PHPUnit_Framework_TestCase
{
private $object;
private $mock;
protected function setUp()
if( !class_exists( '\Illuminate\View\Factory' ) ) {
$this->markTestSkipped( '\Illuminate\View\Factory is not available' );
}
$this->mock = $this->getMockBuilder( '\Illuminate\View\Factory' )
->setMethods( array( 'file' ) )
->disableOriginalConstructor()
->getMock();
$this->object = new \Aimeos\MW\View\Engine\Blade( $this->mock );
protected function tearDown()
unset( $this->object, $this->mock );
public function testRender()
$view = $this->getMockBuilder( '\Illuminate\View\View' )
->setMethods( array( 'render' ) )
$view->expects( $this->once() )->method( 'render' )
->will( $this->returnValue( 'test' ) );
$this->mock->expects( $this->once() )->method( 'file' )
->will( $this->returnValue( $view) );
$result = $this->object->render( 'filepath', array( 'key' => 'value' ) );
$this->assertEquals( 'test', $result );