Esempio 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);
 }
 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.
 }
Esempio 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>');
 }