Add test for sensitivity component partial overrides
Refs #1854 Laravel looks like it broke ->contains($model), fix test for now
This commit is contained in:
parent
8a9355ca66
commit
6aa60305a0
|
|
@ -0,0 +1,5 @@
|
|||
url = "/component-partial-alias-override"
|
||||
|
||||
[October\Tester\Components\Post overRide1]
|
||||
==
|
||||
{% component 'overRide1' %}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
url = "/component-partial-override"
|
||||
|
||||
[October\Tester\Components\Post override1]
|
||||
[testPost]
|
||||
==
|
||||
{% component 'override1' %}
|
||||
{% component 'testPost' %}
|
||||
|
|
@ -1 +1 @@
|
|||
<p>I am an override partial! Yay</p>
|
||||
<p>I am an override alias partial! Yay</p>
|
||||
|
|
@ -0,0 +1 @@
|
|||
<p>I am an override partial! Yay</p>
|
||||
|
|
@ -12,6 +12,13 @@ class ControllerTest extends TestCase
|
|||
|
||||
Model::clearBootedModels();
|
||||
Model::flushEventListeners();
|
||||
|
||||
include_once base_path() . '/tests/fixtures/plugins/october/tester/components/Archive.php';
|
||||
include_once base_path() . '/tests/fixtures/plugins/october/tester/components/Post.php';
|
||||
include_once base_path() . '/tests/fixtures/plugins/october/tester/components/MainMenu.php';
|
||||
include_once base_path() . '/tests/fixtures/plugins/october/tester/components/ContentBlock.php';
|
||||
include_once base_path() . '/tests/fixtures/plugins/october/tester/components/Comments.php';
|
||||
include_once base_path() . '/tests/fixtures/plugins/october/tester/classes/Users.php';
|
||||
}
|
||||
|
||||
public function testThemeUrl()
|
||||
|
|
@ -395,12 +402,33 @@ ESC;
|
|||
$this->assertEquals('<p>DEFAULT MARKUP: I am a post yay</p>', $response);
|
||||
}
|
||||
|
||||
public function testComponentPartialAliasOverride()
|
||||
{
|
||||
$theme = Theme::load('test');
|
||||
$controller = new Controller($theme);
|
||||
$response = $controller->run('/component-partial-alias-override')->getContent();
|
||||
|
||||
//
|
||||
// Testing case sensitivity
|
||||
//
|
||||
// Component alias: overRide1
|
||||
// Target path: partials\override1\default.htm
|
||||
//
|
||||
$this->assertEquals('<p>I am an override alias partial! Yay</p>', $response);
|
||||
}
|
||||
|
||||
public function testComponentPartialOverride()
|
||||
{
|
||||
$theme = Theme::load('test');
|
||||
$controller = new Controller($theme);
|
||||
$response = $controller->run('/component-partial-override')->getContent();
|
||||
|
||||
//
|
||||
// Testing case sensitivity
|
||||
//
|
||||
// Component code: testPost
|
||||
// Target path: partials\testpost\default.htm
|
||||
//
|
||||
$this->assertEquals('<p>I am an override partial! Yay</p>', $response);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,11 +25,11 @@ class BelongsToManyModelTest extends PluginTestCase
|
|||
Model::reguard();
|
||||
|
||||
// Add/remove to collection
|
||||
$this->assertFalse($author->roles->contains($role1));
|
||||
$this->assertFalse($author->roles->contains($role1->id));
|
||||
$author->roles()->add($role1);
|
||||
$author->roles()->add($role2);
|
||||
$this->assertTrue($author->roles->contains($role1));
|
||||
$this->assertTrue($author->roles->contains($role2));
|
||||
$this->assertTrue($author->roles->contains($role1->id));
|
||||
$this->assertTrue($author->roles->contains($role2->id));
|
||||
|
||||
// Set by Model object
|
||||
$author->roles = $role1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue