-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX Index configuration overrides DO subsite field if NULL value
- Loading branch information
Showing
6 changed files
with
184 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
language: php | ||
|
||
dist: trusty | ||
|
||
env: | ||
global: | ||
- COMPOSER_ROOT_VERSION=2.x-dev | ||
- APP_SEARCH_API_KEY='test' | ||
- APP_SEARCH_ENDPOINT='test' | ||
|
||
matrix: | ||
include: | ||
- php: 7.2 | ||
env: DB=MYSQL PHPUNIT_TEST=1 PHPCS_TEST=1 | ||
- php: 7.3 | ||
env: DB=MYSQL PHPUNIT_COVERAGE_TEST=1 | ||
|
||
before_script: | ||
# Init PHP | ||
- phpenv rehash | ||
- phpenv config-rm xdebug.ini | ||
- composer validate | ||
- composer require silverstripe/recipe-cms 4.5.x-dev --no-update | ||
- composer require silverstripe/subsites 2.4.x-dev --no-update | ||
- if [[ $DB == PGSQL ]]; then composer require silverstripe/postgresql:2.0.x-dev --no-update; fi | ||
- if [[ $PHPCS_TEST ]]; then composer global require squizlabs/php_codesniffer:^3 --prefer-dist --no-interaction --no-progress --no-suggest -o; fi | ||
- composer install --prefer-dist --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile | ||
|
||
script: | ||
- if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit tests/; fi | ||
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage.xml; fi | ||
- if [[ $PHPCS_TEST ]]; then vendor/bin/phpcs src/ tests/ ; fi | ||
|
||
after_success: | ||
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace SilverStripe\SearchService\Tests\Fake; | ||
|
||
use SilverStripe\Dev\TestOnly; | ||
use SilverStripe\ORM\DataObject; | ||
use SilverStripe\SearchService\Extensions\SearchServiceExtension; | ||
|
||
class SubsiteDataObjectFake extends DataObject implements TestOnly | ||
{ | ||
private static $table_name = 'SubsiteDataObjectFake'; | ||
|
||
private static $extensions = [ | ||
SearchServiceExtension::class, | ||
]; | ||
|
||
public $can_view; | ||
|
||
private static $has_one = array( | ||
'Subsite' => 'Subsite' | ||
); | ||
|
||
private static $db = [ | ||
'ShowInSearch' => 'Boolean', | ||
]; | ||
|
||
public function canView($member = null) | ||
{ | ||
if (is_callable($this->can_view)) { | ||
$func = $this->can_view; | ||
return $func(); | ||
} | ||
return $this->can_view; | ||
} | ||
} |