Skip to content
Permalink
Browse files

PHPUnit - use expectExpectation in last cases

  • Loading branch information...
keradus committed Nov 16, 2017
1 parent e7a15f8 commit 74a9d8da933961f0de9ea0def4c4a43817e391ad
Showing with 6 additions and 4 deletions.
  1. +6 −4 tests/TestCase/View/ViewTest.php
@@ -934,24 +934,26 @@ public function testPrefixElement()
/**
* Test loading non-existent view element
*
* @expectedException \Cake\View\Exception\MissingElementException
* @expectedExceptionMessageRegExp $Element file \"Element[\\|/]non_existent_element\.ctp\" is missing$
* @return void
*/
public function testElementNonExistent()
{
$this->expectException(\Cake\View\Exception\MissingElementException::class);
$this->expectExceptionMessageRegExp('$Element file \"Element[\\|/]non_existent_element\.ctp\" is missing$');
$this->View->element('non_existent_element');
}
/**
* Test loading non-existent plugin view element
*
* @expectedException \Cake\View\Exception\MissingElementException
* @expectedExceptionMessageRegExp $Element file "test_plugin\.Element[\\|/]plugin_element\.ctp\" is missing$
* @return void
*/
public function testElementInexistentPluginElement()
{
$this->expectException(\Cake\View\Exception\MissingElementException::class);
$this->expectExceptionMessageRegExp('$Element file "test_plugin\.Element[\\|/]plugin_element\.ctp\" is missing$');
$this->View->element('test_plugin.plugin_element');
}

0 comments on commit 74a9d8d

Please sign in to comment.
You can’t perform that action at this time.