Use 3.2 compatible API

This commit is contained in:
Damian Mooyman 2015-02-24 09:34:34 +13:00
parent e6c8dff7be
commit 5b9af35566
7 changed files with 10 additions and 5 deletions

View File

@ -30,5 +30,5 @@ before_script:
- php ~/travis-support/travis_setup_php54_webserver.php --if-env BEHAT_TEST
script:
- "if [ \"$BEHAT_TEST\" = \"\" ]; then phpunit subsites/tests; fi"
- "if [ \"$BEHAT_TEST\" = \"\" ]; then vendor/bin/phpunit subsites/tests; fi"
- "if [ \"$BEHAT_TEST\" = \"1\" ]; then vendor/bin/behat @subsites; fi"

View File

@ -57,7 +57,7 @@ class FileSubsites extends DataExtension {
/**
* Update any requests to limit the results to the current site
*/
public function augmentSQL(SQLSelect $query) {
public function augmentSQL(SQLQuery &$query) {
if(Subsite::$disable_subsite_filter) return;
// If you're querying by ID, ignore the sub-site - this is a bit ugly... (but it was WAYYYYYYYYY worse)

View File

@ -107,7 +107,7 @@ class GroupSubsites extends DataExtension implements PermissionProvider {
/**
* Update any requests to limit the results to the current site
*/
public function augmentSQL(SQLSelect $query) {
public function augmentSQL(SQLQuery &$query) {
if(Subsite::$disable_subsite_filter) return;
if(Cookie::get('noSubsiteFilter') == 'true') return;

View File

@ -12,7 +12,7 @@ class SiteConfigSubsites extends DataExtension {
/**
* Update any requests to limit the results to the current site
*/
public function augmentSQL(SQLSelect $query) {
public function augmentSQL(SQLQuery &$query) {
if(Subsite::$disable_subsite_filter) return;
// If you're querying by ID, ignore the sub-site - this is a bit ugly...

View File

@ -25,7 +25,7 @@ class SiteTreeSubsites extends DataExtension {
/**
* Update any requests to limit the results to the current site
*/
public function augmentSQL(SQLSelect $query, DataQuery $dataQuery = null) {
public function augmentSQL(SQLQuery &$query, DataQuery &$dataQuery = null) {
if(Subsite::$disable_subsite_filter) return;
if($dataQuery->getQueryParam('Subsite.filter') === false) return;

View File

@ -14,6 +14,9 @@
"silverstripe/framework": "~3.2",
"silverstripe/cms": "~3.2"
},
"require-dev": {
"phpunit/PHPUnit": "~3.7@stable"
},
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"

View File

@ -2,6 +2,8 @@
namespace Subsites\Test\Behaviour;
if(!class_exists('SilverStripe\BehatExtension\Context\SilverStripeContext')) return;
use SilverStripe\BehatExtension\Context\SilverStripeContext,
SilverStripe\BehatExtension\Context\BasicContext,
SilverStripe\BehatExtension\Context\LoginContext,