示例#1
0
 /**
  * @covers ::loadStack()
  * @covers \Arvici\Component\View\Render
  */
 public function testLoadCustomStack()
 {
     $this->clearBuilder();
     $this->builder->loadStack('test-sample');
     $stack = Render::getInstance()->raw();
     $this->assertCount(4, $stack);
     $this->assertEquals(View::PART_BODY_PLACEHOLDER, $stack[1]->getType());
     $this->assertEquals(View::PART_BODY, $stack[2]->getType());
     // Invalid
     try {
         $this->builder->loadStack('NONEXISTING');
         $this->assertTrue(false);
     } catch (RendererException $e) {
         $this->assertTrue(true);
     }
 }
示例#2
0
 /**
  * @covers \Arvici\Heart\Renderer\PhpTemplate
  */
 public function testBasicRendering()
 {
     $this->clearBuilder();
     $html = $this->builder->loadStack('test-basicrender')->body('testbody1')->render(array('test' => 'worked'), true);
     $this->assertEquals("--HEADER----=worked=----FOOTER--", $html);
 }