mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge remote-tracking branch 'origin/3.0' into 3.1.0
Conflicts: model/Hierarchy.php
This commit is contained in:
commit
40c239076b
@ -3,3 +3,5 @@ tools:
|
||||
-
|
||||
scope: file
|
||||
command: php tests/phpcs_runner.php %pathname%
|
||||
filter:
|
||||
excluded_paths: ["*/css/*", "css/*", "thirdparty/*", "*/jquery-changetracker/*", "parsers/HTML/BBCodeParser/*", "*/SSTemplateParser.php$", "docs/*", "*/images/*"]
|
||||
|
@ -56,7 +56,9 @@ class CheckboxField_Readonly extends ReadonlyField {
|
||||
}
|
||||
|
||||
public function Value() {
|
||||
return Convert::raw2xml($this->value ? _t('CheckboxField.YESANSWER', 'Yes') : _t('CheckboxField.NOANSWER', 'No'));
|
||||
return Convert::raw2xml($this->value ?
|
||||
_t('CheckboxField.YESANSWER', 'Yes') :
|
||||
_t('CheckboxField.NOANSWER', 'No'));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -246,10 +246,13 @@ class CmsUiContext extends BehatContext
|
||||
public function thePreviewContains($content)
|
||||
{
|
||||
$driver = $this->getSession()->getDriver();
|
||||
$driver->switchToIFrame('cms-preview-iframe');
|
||||
// TODO Remove once we have native support in Mink and php-webdriver,
|
||||
// see https://groups.google.com/forum/#!topic/behat/QNhOuGHKEWI
|
||||
$origWindowName = $driver->getWebDriverSession()->window_handle();
|
||||
|
||||
$driver->switchToIFrame('cms-preview-iframe');
|
||||
$this->getMainContext()->assertPageContainsText($content);
|
||||
$driver->switchToWindow();
|
||||
$driver->switchToWindow($origWindowName);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -304,10 +307,13 @@ class CmsUiContext extends BehatContext
|
||||
public function thePreviewDoesNotContain($content)
|
||||
{
|
||||
$driver = $this->getSession()->getDriver();
|
||||
$driver->switchToIFrame('cms-preview-iframe');
|
||||
// TODO Remove once we have native support in Mink and php-webdriver,
|
||||
// see https://groups.google.com/forum/#!topic/behat/QNhOuGHKEWI
|
||||
$origWindowName = $driver->getWebDriverSession()->window_handle();
|
||||
|
||||
$driver->switchToIFrame('cms-preview-iframe');
|
||||
$this->getMainContext()->assertPageNotContainsText($content);
|
||||
$driver->switchToWindow();
|
||||
$driver->switchToWindow($origWindowName);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -130,7 +130,8 @@ class HTTPTest extends SapphireTest {
|
||||
// background-image
|
||||
// Note that using /./ in urls is absolutely acceptable
|
||||
$test->assertEquals(
|
||||
'<div style="background-image: url(\'http://www.silverstripe.org/./images/mybackground.gif\');">Content</div>',
|
||||
'<div style="background-image: url(\'http://www.silverstripe.org/./images/mybackground.gif\');">'.
|
||||
'Content</div>',
|
||||
HTTP::absoluteURLs('<div style="background-image: url(\'./images/mybackground.gif\');">Content</div>')
|
||||
);
|
||||
|
||||
@ -169,7 +170,8 @@ class HTTPTest extends SapphireTest {
|
||||
// background
|
||||
// Note that using /./ in urls is absolutely acceptable
|
||||
$test->assertEquals(
|
||||
'<div background="http://www.silverstripe.org/./themes/silverstripe/images/nav-bg-repeat-2.png">SS Blog</div>',
|
||||
'<div background="http://www.silverstripe.org/./themes/silverstripe/images/nav-bg-repeat-2.png">'.
|
||||
'SS Blog</div>',
|
||||
HTTP::absoluteURLs('<div background="./themes/silverstripe/images/nav-bg-repeat-2.png">SS Blog</div>')
|
||||
);
|
||||
|
||||
|
@ -24,11 +24,13 @@ class CoreTest extends SapphireTest {
|
||||
$user = getTempFolderUsername();
|
||||
|
||||
// A typical Windows location for where sites are stored on IIS
|
||||
$this->assertEquals(sys_get_temp_dir() . '/silverstripe-cacheC--inetpub-wwwroot-silverstripe-test-project/' . $user,
|
||||
$this->assertEquals(sys_get_temp_dir() .
|
||||
'/silverstripe-cacheC--inetpub-wwwroot-silverstripe-test-project/' . $user,
|
||||
getTempFolder('C:\\inetpub\\wwwroot\\silverstripe-test-project'));
|
||||
|
||||
// A typical Mac OS X location for where sites are stored
|
||||
$this->assertEquals(sys_get_temp_dir() . '/silverstripe-cache-Users-joebloggs-Sites-silverstripe-test-project/' . $user,
|
||||
$this->assertEquals(sys_get_temp_dir() .
|
||||
'/silverstripe-cache-Users-joebloggs-Sites-silverstripe-test-project/' . $user,
|
||||
getTempFolder('/Users/joebloggs/Sites/silverstripe-test-project'));
|
||||
|
||||
// A typical Linux location for where sites are stored
|
||||
|
@ -12,14 +12,18 @@ if(!empty($_SERVER['argv'][1])) {
|
||||
|
||||
$result = array('comments' => array());
|
||||
|
||||
// Run each sniff
|
||||
$extension = pathinfo($path, PATHINFO_EXTENSION);
|
||||
|
||||
// phpcs --encoding=utf-8 --standard=framework/tests/phpcs/tabs.xml
|
||||
run_sniff('tabs.xml', $path, $result);
|
||||
// Whitelist of extensions to check (default phpcs list)
|
||||
if(in_array($extension, array('php', 'js', 'inc', 'css'))) {
|
||||
// Run each sniff
|
||||
|
||||
// phpcs --encoding=utf-8 --tab-width=4 --standard=framework/tests/phpcs/ruleset.xml
|
||||
run_sniff('ruleset.xml', $path, $result, '--tab-width=4');
|
||||
// phpcs --encoding=utf-8 --standard=framework/tests/phpcs/tabs.xml
|
||||
run_sniff('tabs.xml', $path, $result);
|
||||
|
||||
// phpcs --encoding=utf-8 --tab-width=4 --standard=framework/tests/phpcs/ruleset.xml
|
||||
run_sniff('ruleset.xml', $path, $result, '--tab-width=4');
|
||||
}
|
||||
echo json_encode($result);
|
||||
|
||||
function run_sniff($standard, $path, array &$result, $extraFlags = '') {
|
||||
|
Loading…
Reference in New Issue
Block a user