mirror of
https://github.com/silverstripe/silverstripe-comments
synced 2024-10-22 11:05:49 +02:00
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:
commit
a1a42009cc
10
.travis.yml
10
.travis.yml
@ -4,19 +4,19 @@ dist: trusty
|
|||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- php: 5.6
|
- 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
|
- php: 7.0
|
||||||
env: DB=PGSQL PHPUNIT_TEST=1
|
env: DB=PGSQL INSTALLER_VERSION=4.1.x-dev PHPUNIT_TEST=1
|
||||||
- php: 7.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
|
- php: 7.2
|
||||||
env: DB=MYSQL PHPUNIT_TEST=1
|
env: DB=MYSQL INSTALLER_VERSION=4.x-dev PHPUNIT_TEST=1
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- phpenv rehash
|
- phpenv rehash
|
||||||
- phpenv config-rm xdebug.ini
|
- phpenv config-rm xdebug.ini
|
||||||
- composer validate
|
- 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
|
- 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
|
- composer install --prefer-dist --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile
|
||||||
|
|
||||||
|
@ -8,13 +8,13 @@ use SilverStripe\Comments\Admin\CommentsGridFieldAction;
|
|||||||
use SilverStripe\Comments\Admin\CommentsGridFieldConfig;
|
use SilverStripe\Comments\Admin\CommentsGridFieldConfig;
|
||||||
use SilverStripe\Comments\Model\Comment;
|
use SilverStripe\Comments\Model\Comment;
|
||||||
use SilverStripe\Comments\Tests\Stubs\CommentableItem;
|
use SilverStripe\Comments\Tests\Stubs\CommentableItem;
|
||||||
|
use SilverStripe\Comments\Tests\Stubs\Team;
|
||||||
use SilverStripe\Control\Controller;
|
use SilverStripe\Control\Controller;
|
||||||
use SilverStripe\Dev\SapphireTest;
|
use SilverStripe\Dev\SapphireTest;
|
||||||
use SilverStripe\Forms\FieldList;
|
use SilverStripe\Forms\FieldList;
|
||||||
use SilverStripe\Forms\Form;
|
use SilverStripe\Forms\Form;
|
||||||
use SilverStripe\Forms\GridField\GridField;
|
use SilverStripe\Forms\GridField\GridField;
|
||||||
use SilverStripe\Forms\GridField\GridFieldDeleteAction;
|
use SilverStripe\Forms\GridField\GridFieldDeleteAction;
|
||||||
use SilverStripe\Forms\Tests\GridField\GridFieldTest\Team;
|
|
||||||
use SilverStripe\ORM\ArrayList;
|
use SilverStripe\ORM\ArrayList;
|
||||||
use SilverStripe\ORM\DataList;
|
use SilverStripe\ORM\DataList;
|
||||||
use SilverStripe\ORM\DataObject;
|
use SilverStripe\ORM\DataObject;
|
||||||
@ -25,6 +25,7 @@ class CommentsGridFieldActionTest extends SapphireTest
|
|||||||
|
|
||||||
protected static $extra_dataobjects = [
|
protected static $extra_dataobjects = [
|
||||||
CommentableItem::class,
|
CommentableItem::class,
|
||||||
|
Team::class,
|
||||||
];
|
];
|
||||||
|
|
||||||
/** @var ArrayList */
|
/** @var ArrayList */
|
||||||
|
19
tests/Stubs/Cheerleader.php
Normal file
19
tests/Stubs/Cheerleader.php
Normal 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
24
tests/Stubs/Player.php
Normal 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
35
tests/Stubs/Team.php
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user