mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
Merge remote-tracking branch 'origin/3.2' into 3
This commit is contained in:
commit
71b23b622c
25
.travis.yml
25
.travis.yml
@ -1,4 +1,11 @@
|
|||||||
language: php
|
language: php
|
||||||
|
|
||||||
|
sudo: false
|
||||||
|
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- tidy
|
||||||
|
|
||||||
php:
|
php:
|
||||||
- 5.4
|
- 5.4
|
||||||
@ -20,8 +27,13 @@ env:
|
|||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- php: hhvm-nightly
|
- php: hhvm
|
||||||
|
- php: 7.0
|
||||||
|
- php: nightly
|
||||||
|
|
||||||
include:
|
include:
|
||||||
|
- php: 5.4
|
||||||
|
env: DB=MYSQL PDO=1
|
||||||
- php: 5.5
|
- php: 5.5
|
||||||
env: DB=MYSQL
|
env: DB=MYSQL
|
||||||
- php: 5.6
|
- php: 5.6
|
||||||
@ -30,11 +42,12 @@ matrix:
|
|||||||
env: DB=MYSQL BEHAT_TEST=1
|
env: DB=MYSQL BEHAT_TEST=1
|
||||||
- php: 5.3
|
- php: 5.3
|
||||||
env: DB=MYSQL
|
env: DB=MYSQL
|
||||||
- php: hhvm-nightly
|
- php: 7.0
|
||||||
|
env: DB=MYSQL
|
||||||
|
- php: nightly
|
||||||
|
env: DB=MYSQL
|
||||||
|
- php: hhvm
|
||||||
env: DB=MYSQL
|
env: DB=MYSQL
|
||||||
before_install:
|
|
||||||
- sudo apt-get update -qq
|
|
||||||
- sudo apt-get install -y tidy
|
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- composer self-update || true
|
- composer self-update || true
|
||||||
|
@ -402,15 +402,15 @@ HTML;
|
|||||||
if($action == "index") $action = "";
|
if($action == "index") $action = "";
|
||||||
else $action = '_' . $action;
|
else $action = '_' . $action;
|
||||||
|
|
||||||
// Find templates by dataRecord
|
$templates = array_merge(
|
||||||
$templates = SSViewer::get_templates_by_class(get_class($this->dataRecord), $action, "SiteTree");
|
// Find templates by dataRecord
|
||||||
|
SSViewer::get_templates_by_class(get_class($this->dataRecord), $action, "SiteTree"),
|
||||||
// Next, we need to add templates for all controllers
|
// Next, we need to add templates for all controllers
|
||||||
$templates += SSViewer::get_templates_by_class(get_class($this), $action, "Controller");
|
SSViewer::get_templates_by_class(get_class($this), $action, "Controller"),
|
||||||
|
// Fail-over to the same for the "index" action
|
||||||
// Fail-over to the same for the "index" action
|
SSViewer::get_templates_by_class(get_class($this->dataRecord), "", "SiteTree"),
|
||||||
$templates += SSViewer::get_templates_by_class(get_class($this->dataRecord), "", "SiteTree");
|
SSViewer::get_templates_by_class(get_class($this), "", "Controller")
|
||||||
$templates += SSViewer::get_templates_by_class(get_class($this), "", "Controller");
|
);
|
||||||
|
|
||||||
return new SSViewer($templates);
|
return new SSViewer($templates);
|
||||||
}
|
}
|
||||||
|
@ -168,6 +168,14 @@ class ContentControllerTest extends FunctionalTest {
|
|||||||
// to say the default Page.ss template
|
// to say the default Page.ss template
|
||||||
$response = $self->get($page->RelativeLink("testwithouttemplate"));
|
$response = $self->get($page->RelativeLink("testwithouttemplate"));
|
||||||
$self->assertEquals("Page", $response->getBody());
|
$self->assertEquals("Page", $response->getBody());
|
||||||
|
|
||||||
|
// Test that an action with a template will render the both action template *and* the
|
||||||
|
// correct parent template
|
||||||
|
$controller = new ContentController($page);
|
||||||
|
$viewer = $controller->getViewer('test');
|
||||||
|
$templateList = array('ContentControllerTestPage_test', 'Page');
|
||||||
|
$expected = SS_TemplateLoader::instance()->findTemplates($templateList, 'controllertest');
|
||||||
|
$self->assertEquals($expected, $viewer->templates());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user