Skip to content

Commit

Permalink
Add tests for #9246
Browse files Browse the repository at this point in the history
Remove a redundant element, and add an element for testing
`plugin=>false` mode.
  • Loading branch information
markstory committed Sep 16, 2016
1 parent c59d9c3 commit 589be7a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions tests/TestCase/View/ViewTest.php
Expand Up @@ -844,7 +844,7 @@ public function testElementExists()
$this->assertFalse($result);

$this->View->plugin = 'TestPlugin';
$result = $this->View->elementExists('test_plugin_element');
$result = $this->View->elementExists('plugin_element');
$this->assertTrue($result);
}

Expand All @@ -859,11 +859,14 @@ public function testElement()
$this->assertEquals('this is the test element', $result);

$result = $this->View->element('TestPlugin.plugin_element');
$this->assertEquals('this is the plugin element using params[plugin]', $result);
$this->assertEquals("Element in the TestPlugin\n", $result);

$this->View->plugin = 'TestPlugin';
$result = $this->View->element('test_plugin_element');
$this->assertEquals('this is the test set using View::$plugin plugin element', $result);
$result = $this->View->element('plugin_element');
$this->assertEquals("Element in the TestPlugin\n", $result);

$result = $this->View->element('plugin_element', [], ['plugin' => false]);
$this->assertEquals("Plugin element overridden in app\n", $result);
}

/**
Expand Down
@@ -1 +1 @@
this is the plugin element using params[plugin]
Element in the TestPlugin

This file was deleted.

1 change: 1 addition & 0 deletions tests/test_app/TestApp/Template/Element/plugin_element.ctp
@@ -0,0 +1 @@
Plugin element overridden in app

0 comments on commit 589be7a

Please sign in to comment.