Merge pull request #258 from creative-commoners/pulls/3.1/travis-recipes

Add various recipe versions to Travis build matrix
This commit is contained in:
Dylan Wagstaff 2018-06-22 20:10:14 +12:00 committed by GitHub
commit a1a42009cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 85 additions and 6 deletions

View File

@ -4,19 +4,19 @@ dist: trusty
matrix:
include:
- php: 5.6
env: DB=MYSQL PHPCS_TEST=1 PHPUNIT_TEST=1
env: DB=MYSQL INSTALLER_VERSION=4.0.x-dev PHPCS_TEST=1 PHPUNIT_TEST=1
- php: 7.0
env: DB=PGSQL PHPUNIT_TEST=1
env: DB=PGSQL INSTALLER_VERSION=4.1.x-dev PHPUNIT_TEST=1
- php: 7.1
env: DB=MYSQL PHPUNIT_COVERAGE_TEST=1
env: DB=MYSQL INSTALLER_VERSION=4.2.x-dev PHPUNIT_COVERAGE_TEST=1
- php: 7.2
env: DB=MYSQL PHPUNIT_TEST=1
env: DB=MYSQL INSTALLER_VERSION=4.x-dev PHPUNIT_TEST=1
before_script:
- phpenv rehash
- phpenv config-rm xdebug.ini
- composer validate
- composer require silverstripe/installer:4.0.x-dev ezyang/htmlpurifier:* --no-update
- composer require silverstripe/installer:"$INSTALLER_VERSION" ezyang/htmlpurifier:* --no-update
- if [[ $DB == PGSQL ]]; then composer require --no-update silverstripe/postgresql:2.0.x-dev; fi
- composer install --prefer-dist --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile

View File

@ -8,13 +8,13 @@ use SilverStripe\Comments\Admin\CommentsGridFieldAction;
use SilverStripe\Comments\Admin\CommentsGridFieldConfig;
use SilverStripe\Comments\Model\Comment;
use SilverStripe\Comments\Tests\Stubs\CommentableItem;
use SilverStripe\Comments\Tests\Stubs\Team;
use SilverStripe\Control\Controller;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\Form;
use SilverStripe\Forms\GridField\GridField;
use SilverStripe\Forms\GridField\GridFieldDeleteAction;
use SilverStripe\Forms\Tests\GridField\GridFieldTest\Team;
use SilverStripe\ORM\ArrayList;
use SilverStripe\ORM\DataList;
use SilverStripe\ORM\DataObject;
@ -25,6 +25,7 @@ class CommentsGridFieldActionTest extends SapphireTest
protected static $extra_dataobjects = [
CommentableItem::class,
Team::class,
];
/** @var ArrayList */

View File

@ -0,0 +1,19 @@
<?php
namespace SilverStripe\Comments\Tests\Stubs;
use SilverStripe\Dev\TestOnly;
use SilverStripe\ORM\DataObject;
class Cheerleader extends DataObject implements TestOnly
{
private static $table_name = 'CommentsTest_Cheerleader';
private static $db = [
'Name' => 'Varchar',
];
private static $has_one = [
'Team' => Team::class,
];
}

24
tests/Stubs/Player.php Normal file
View File

@ -0,0 +1,24 @@
<?php
namespace SilverStripe\Comments\Tests\Stubs;
use SilverStripe\Dev\TestOnly;
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\ManyManyList;
/**
* @method ManyManyList Teams()
*/
class Player extends DataObject implements TestOnly
{
private static $table_name = 'CommentsTest_Player';
private static $db = array(
'Name' => 'Varchar',
'Email' => 'Varchar',
);
private static $belongs_many_many = [
'Teams' => Team::class,
];
}

35
tests/Stubs/Team.php Normal file
View File

@ -0,0 +1,35 @@
<?php
namespace SilverStripe\Comments\Tests\Stubs;
use SilverStripe\Dev\TestOnly;
use SilverStripe\ORM\DataObject;
class Team extends DataObject implements TestOnly
{
private static $table_name = 'CommentsTest_Team';
private static $db = array(
'Name' => 'Varchar',
'City' => 'Varchar',
);
private static $many_many = [
'Players' => Player::class,
];
private static $has_many = [
'Cheerleaders' => Cheerleader::class,
];
private static $searchable_fields = [
'Name',
'City',
'Cheerleaders.Name',
];
public function canView($member = null)
{
return true;
}
}