mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #6257 from open-sausages/simpler-test-run
BUG restore CMS build as required in framework tests
This commit is contained in:
commit
82c3bc7c98
@ -32,11 +32,6 @@ 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
|
||||||
allow_failures:
|
|
||||||
- php: 5.6
|
|
||||||
env: DB=MYSQL CMS_TEST=1 PHPUNIT_TEST=1
|
|
||||||
- php: 5.6
|
|
||||||
env: DB=MYSQL CMS_TEST=1 BEHAT_TEST=1
|
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- printf "\n" | pecl install imagick
|
- printf "\n" | pecl install imagick
|
||||||
@ -50,6 +45,7 @@ before_script:
|
|||||||
- "if [ \"$DB\" = \"PGSQL\" ]; then composer require silverstripe/postgresql:2.0.x-dev --prefer-dist; fi"
|
- "if [ \"$DB\" = \"PGSQL\" ]; then composer require silverstripe/postgresql:2.0.x-dev --prefer-dist; fi"
|
||||||
- "if [ \"$DB\" = \"SQLITE\" ]; then composer require silverstripe/sqlite3:2.0.x-dev --prefer-dist; fi"
|
- "if [ \"$DB\" = \"SQLITE\" ]; then composer require silverstripe/sqlite3:2.0.x-dev --prefer-dist; fi"
|
||||||
- "if [ \"$CMS_TEST\" = \"1\" ]; then COMPOSER_ROOT_VERSION=4.0.x-dev composer require silverstripe/cms:4.0.x-dev silverstripe/siteconfig:4.0.x-dev silverstripe/reports:4.0.x-dev --prefer-dist; fi"
|
- "if [ \"$CMS_TEST\" = \"1\" ]; then COMPOSER_ROOT_VERSION=4.0.x-dev composer require silverstripe/cms:4.0.x-dev silverstripe/siteconfig:4.0.x-dev silverstripe/reports:4.0.x-dev --prefer-dist; fi"
|
||||||
|
- "if [ \"$CMS_TEST\" = \"1\" ]; then php ./cms/tests/bootstrap/mysite.php; fi"
|
||||||
- "if [ \"$NPM_TEST\" = \"1\" ] && [ `git log --format=format:%aE -1` = \"support@greenkeeper.io\" ]; then echo \"Removing npm-shrinkwrap.json\"; rm npm-shrinkwrap.json; fi"
|
- "if [ \"$NPM_TEST\" = \"1\" ] && [ `git log --format=format:%aE -1` = \"support@greenkeeper.io\" ]; then echo \"Removing npm-shrinkwrap.json\"; rm npm-shrinkwrap.json; fi"
|
||||||
- "if [ \"$NPM_TEST\" = \"1\" ]; then nvm install $TRAVIS_NODE_VERSION && npm install; fi"
|
- "if [ \"$NPM_TEST\" = \"1\" ]; then nvm install $TRAVIS_NODE_VERSION && npm install; fi"
|
||||||
- "if [ \"$BEHAT_TEST\" = \"1\" ]; then sh -e /etc/init.d/xvfb start; sleep 3; fi"
|
- "if [ \"$BEHAT_TEST\" = \"1\" ]; then sh -e /etc/init.d/xvfb start; sleep 3; fi"
|
||||||
@ -60,7 +56,7 @@ script:
|
|||||||
- "if [ \"$PHPUNIT_TEST\" = \"1\" ] && [ \"$CMS_TEST\" = \"\" ]; then vendor/bin/phpunit; fi"
|
- "if [ \"$PHPUNIT_TEST\" = \"1\" ] && [ \"$CMS_TEST\" = \"\" ]; then vendor/bin/phpunit; fi"
|
||||||
- "if [ \"$PHPUNIT_TEST\" = \"1\" ] && [ \"$CMS_TEST\" = \"1\" ]; then vendor/bin/phpunit cms/tests; fi"
|
- "if [ \"$PHPUNIT_TEST\" = \"1\" ] && [ \"$CMS_TEST\" = \"1\" ]; then vendor/bin/phpunit cms/tests; fi"
|
||||||
- "if [ \"$BEHAT_TEST\" = \"1\" ] && [ \"$CMS_TEST\" = \"\" ]; then vendor/bin/behat --config tests/behat/config.yml .; fi"
|
- "if [ \"$BEHAT_TEST\" = \"1\" ] && [ \"$CMS_TEST\" = \"\" ]; then vendor/bin/behat --config tests/behat/config.yml .; fi"
|
||||||
- "if [ \"$BEHAT_TEST\" = \"1\" ] && [ \"$CMS_TEST\" = \"1\" ]; then vendor/bin/behat @cms --config cms/tests/behat/behat.yml; fi"
|
- "if [ \"$BEHAT_TEST\" = \"1\" ] && [ \"$CMS_TEST\" = \"1\" ]; then vendor/bin/behat @cms --config tests/behat/cms-config.yml; fi"
|
||||||
- "if [ \"$NPM_TEST\" = \"1\" ]; then npm run test; fi"
|
- "if [ \"$NPM_TEST\" = \"1\" ]; then npm run test; fi"
|
||||||
- "if [ \"$NPM_TEST\" = \"1\" ]; then npm run lint; fi"
|
- "if [ \"$NPM_TEST\" = \"1\" ]; then npm run lint; fi"
|
||||||
- "if [ \"$NPM_TEST\" = \"1\" ]; then npm run build; fi"
|
- "if [ \"$NPM_TEST\" = \"1\" ]; then npm run build; fi"
|
||||||
|
@ -21,10 +21,12 @@ class TinyMCEConfig extends HTMLEditorConfig {
|
|||||||
* - themes
|
* - themes
|
||||||
* - skins
|
* - skins
|
||||||
*
|
*
|
||||||
|
* If left blank defaults to ADMIN_THIRDPARTY_DIR . '/tinymce'
|
||||||
|
*
|
||||||
* @config
|
* @config
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
private static $base_dir = 'framework/admin/thirdparty/tinymce';
|
private static $base_dir = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TinyMCE JS settings
|
* TinyMCE JS settings
|
||||||
@ -366,7 +368,7 @@ class TinyMCEConfig extends HTMLEditorConfig {
|
|||||||
// https://www.tinymce.com/docs/api/class/tinymce.editormanager/#baseURL
|
// https://www.tinymce.com/docs/api/class/tinymce.editormanager/#baseURL
|
||||||
$tinyMCEBaseURL = Controller::join_links(
|
$tinyMCEBaseURL = Controller::join_links(
|
||||||
Director::absoluteBaseURL(),
|
Director::absoluteBaseURL(),
|
||||||
$this->config()->base_dir
|
$this->config()->get('base_dir') ?: ADMIN_THIRDPARTY_DIR . '/tinymce'
|
||||||
);
|
);
|
||||||
$settings['baseURL'] = $tinyMCEBaseURL;
|
$settings['baseURL'] = $tinyMCEBaseURL;
|
||||||
|
|
||||||
|
22
tests/behat/cms-config.yml
Normal file
22
tests/behat/cms-config.yml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# Required to run cms tests as subdirectory within framework module
|
||||||
|
default:
|
||||||
|
context:
|
||||||
|
class: SilverStripe\Cms\Test\Behaviour\FeatureContext
|
||||||
|
formatter:
|
||||||
|
name: pretty
|
||||||
|
parameters:
|
||||||
|
snippets: false
|
||||||
|
|
||||||
|
extensions:
|
||||||
|
SilverStripe\BehatExtension\MinkExtension:
|
||||||
|
base_url: http://localhost:8080/
|
||||||
|
files_path: %behat.paths.base%/features/files/
|
||||||
|
default_session: selenium2
|
||||||
|
javascript_session: selenium2
|
||||||
|
selenium2:
|
||||||
|
browser: firefox
|
||||||
|
|
||||||
|
SilverStripe\BehatExtension\Extension:
|
||||||
|
screenshot_path: %behat.paths.base%/artifacts/screenshots
|
||||||
|
framework_path: "../.."
|
||||||
|
bootstrap_file: "cms/tests/behat/serve-bootstrap.php"
|
@ -11,7 +11,7 @@ default:
|
|||||||
extensions:
|
extensions:
|
||||||
SilverStripe\BehatExtension\MinkExtension:
|
SilverStripe\BehatExtension\MinkExtension:
|
||||||
base_url: http://localhost:8080/
|
base_url: http://localhost:8080/
|
||||||
files_path: %behat.paths.base%/tests/behat/features/files/
|
files_path: %behat.paths.base%/features/files/
|
||||||
default_session: selenium2
|
default_session: selenium2
|
||||||
javascript_session: selenium2
|
javascript_session: selenium2
|
||||||
selenium2:
|
selenium2:
|
||||||
|
@ -19,3 +19,7 @@ ini_set('display_errors', 1);
|
|||||||
if(!file_exists(BASE_PATH . '/assets')) {
|
if(!file_exists(BASE_PATH . '/assets')) {
|
||||||
mkdir(BASE_PATH . '/assets', 02775);
|
mkdir(BASE_PATH . '/assets', 02775);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($_SERVER['HTTP_HOST'])) {
|
||||||
|
$_SERVER['HTTP_HOST'] = 'localhost';
|
||||||
|
}
|
||||||
|
@ -76,7 +76,7 @@ class HTMLEditorConfigTest extends SapphireTest {
|
|||||||
// Plugin specified with standard location
|
// Plugin specified with standard location
|
||||||
$this->assertContains('plugin4', array_keys($plugins));
|
$this->assertContains('plugin4', array_keys($plugins));
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
'http://mysite.com/subdir/framework/admin/thirdparty/tinymce/plugins/plugin4/plugin.min.js',
|
'http://mysite.com/subdir/'.ADMIN_THIRDPARTY_DIR.'/tinymce/plugins/plugin4/plugin.min.js',
|
||||||
$plugins['plugin4']
|
$plugins['plugin4']
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user