mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-06-26 14:39:25 +02:00
commit
5347d660a0
12
.travis.yml
12
.travis.yml
|
@ -18,14 +18,12 @@ env:
|
||||||
matrix:
|
matrix:
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
include:
|
include:
|
||||||
- php: 5.5
|
|
||||||
env: DB=MYSQL PHPUNIT_TEST=1
|
|
||||||
- php: 5.5
|
- php: 5.5
|
||||||
env: DB=PGSQL PHPUNIT_TEST=1
|
env: DB=PGSQL PHPUNIT_TEST=1
|
||||||
- php: 5.5
|
|
||||||
env: DB=SQLITE PHPUNIT_TEST=1
|
|
||||||
- php: 5.6
|
- php: 5.6
|
||||||
env: DB=MYSQL PDO=1 PHPUNIT_TEST=1
|
env: DB=MYSQL PHPUNIT_TEST=1
|
||||||
|
- php: 7.0
|
||||||
|
env: DB=MYSQL PDO=1 PHPUNIT_COVERAGE_TEST=1
|
||||||
- php: 5.6
|
- php: 5.6
|
||||||
env: DB=MYSQL BEHAT_TEST=1
|
env: DB=MYSQL BEHAT_TEST=1
|
||||||
- php: 5.6
|
- php: 5.6
|
||||||
|
@ -34,15 +32,11 @@ matrix:
|
||||||
env: DB=MYSQL CMS_TEST=1 PHPUNIT_TEST=1
|
env: DB=MYSQL CMS_TEST=1 PHPUNIT_TEST=1
|
||||||
- php: 5.6
|
- php: 5.6
|
||||||
env: DB=MYSQL CMS_TEST=1 BEHAT_TEST=1
|
env: DB=MYSQL CMS_TEST=1 BEHAT_TEST=1
|
||||||
- php: 7.0
|
|
||||||
env: DB=MYSQL PDO=1 PHPUNIT_COVERAGE_TEST=1
|
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- php: 5.6
|
- php: 5.6
|
||||||
env: DB=MYSQL CMS_TEST=1 PHPUNIT_TEST=1
|
env: DB=MYSQL CMS_TEST=1 PHPUNIT_TEST=1
|
||||||
- php: 5.6
|
- php: 5.6
|
||||||
env: DB=MYSQL CMS_TEST=1 BEHAT_TEST=1
|
env: DB=MYSQL CMS_TEST=1 BEHAT_TEST=1
|
||||||
- php: 7.0
|
|
||||||
env: DB=MYSQL PDO=1 PHPUNIT_COVERAGE_TEST=1
|
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- printf "\n" | pecl install imagick
|
- printf "\n" | pecl install imagick
|
||||||
|
|
|
@ -81,12 +81,25 @@ class ViewableData extends Object implements IteratorAggregate {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a field exists on this object or its failover.
|
* Check if a field exists on this object or its failover.
|
||||||
|
* Note that, unlike the core isset() implementation, this will return true if the property is defined
|
||||||
|
* and set to null.
|
||||||
*
|
*
|
||||||
* @param string $property
|
* @param string $property
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function __isset($property) {
|
public function __isset($property) {
|
||||||
return $this->hasField($property) || ($this->failover && $this->failover->hasField($property));
|
// getField() isn't a field-specific getter and shouldn't be treated as such
|
||||||
|
if(strtolower($property) !== 'field' && $this->hasMethod($method = "get$property")) {
|
||||||
|
return true;
|
||||||
|
|
||||||
|
} elseif($this->hasField($property)) {
|
||||||
|
return true;
|
||||||
|
|
||||||
|
} elseif($this->failover) {
|
||||||
|
return isset($this->failover->$property);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -97,13 +110,17 @@ class ViewableData extends Object implements IteratorAggregate {
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function __get($property) {
|
public function __get($property) {
|
||||||
if($this->hasMethod($method = "get$property")) {
|
// getField() isn't a field-specific getter and shouldn't be treated as such
|
||||||
|
if(strtolower($property) !== 'field' && $this->hasMethod($method = "get$property")) {
|
||||||
return $this->$method();
|
return $this->$method();
|
||||||
|
|
||||||
} elseif($this->hasField($property)) {
|
} elseif($this->hasField($property)) {
|
||||||
return $this->getField($property);
|
return $this->getField($property);
|
||||||
|
|
||||||
} elseif($this->failover) {
|
} elseif($this->failover) {
|
||||||
return $this->failover->$property;
|
return $this->failover->$property;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1551,7 +1551,7 @@ EOC;
|
||||||
$parser = new SSTemplateParser();
|
$parser = new SSTemplateParser();
|
||||||
$parser->addClosedBlock(
|
$parser->addClosedBlock(
|
||||||
'test',
|
'test',
|
||||||
function (&$res) use (&$count) {
|
function ($res) use (&$count) {
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -1567,7 +1567,7 @@ EOC;
|
||||||
$parser = new SSTemplateParser();
|
$parser = new SSTemplateParser();
|
||||||
$parser->addOpenBlock(
|
$parser->addOpenBlock(
|
||||||
'test',
|
'test',
|
||||||
function (&$res) use (&$count) {
|
function ($res) use (&$count) {
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user