Exemplo n.º 1
0
 public function testDisplay()
 {
     $view = new ViewNoaccess();
     ob_start();
     $view->display();
     $output = ob_get_contents();
     ob_end_clean();
     $this->assertEquals('<p class="error">Warning: You do not have permission to access this module.</p>', $output);
 }
Exemplo n.º 2
0
 public function testdisplay()
 {
     //executet the method and check for default attributes and check that it returns some html.
     $view = new ViewNoaccess();
     ob_start();
     $view->display();
     $renderedContent = ob_get_contents();
     ob_end_clean();
     $this->assertAttributeEquals('noaccess', 'type', $view);
     $this->assertGreaterThan(0, strlen($renderedContent));
     $this->assertEquals(false, json_decode($renderedContent));
     //check that it doesn't return json.
 }
Exemplo n.º 3
0
 public function testDisplay()
 {
     $view = new ViewNoaccess();
     $view->display();
     $this->expectedString('<p class="error">Warning: You do not have permission to access this module.</p>');
 }