Example #1
0
File: page.php Project: cmsx/page
 function testRender()
 {
     $p = new Page();
     $p->setTemplate('body.php')->set('hello', '<b>World</b>')->setDomain('http://www.cmsx.ru')->setCanonical('/')->addCSS('file.css')->addCSS('ie.css')->addJS('hi.js')->addJS('js.js');
     $html = $p->render();
     $this->assertNotEmpty($html, 'Рендер не пустой');
     $this->assertEquals($html, (string) $p, 'Приведение к строке');
     $this->assertSelectCount('head title', true, $html, 'Тайтл');
     $this->assertSelectCount('head meta[name=keywords]', true, $html, 'Keywords');
     $this->assertSelectCount('head meta[name=description]', true, $html, 'Description');
     $this->assertSelectCount('link[rel=canonical]', true, $html, '');
     $this->assertSelectCount('link[rel=stylesheet]', 2, $html, 'Стили CSS');
     $this->assertSelectCount('html body script[type=text/javascript]', 2, $html, 'Скрипты');
     $this->assertSelectCount('html body b', true, $html, 'Тело страницы');
 }