コード例 #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);
 }
コード例 #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.
 }
コード例 #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>');
 }