Skip to content

Commit

Permalink
Merge pull request #17 from creative-commoners/pulls/2.2/vendoring-ma…
Browse files Browse the repository at this point in the history
…chines

NEW Vendorise module, use new exposed Requirements API and update CI config
  • Loading branch information
NightJar authored Oct 25, 2017
2 parents 1297645 + dee284b commit fe7550a
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 41 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ before_script:

# Install composer dependencies
- composer install --prefer-dist
- composer require --prefer-dist --no-update silverstripe/framework:4.0.x-dev silverstripe/cms:4.0.x-dev silverstripe/admin:1.0.x-dev
- composer require --prefer-dist --no-update silverstripe/recipe-cms 1.0.x-dev
- composer update

script:
- if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit; 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
- if [[ $PHPCS_TEST ]]; then vendor/bin/phpcs --standard=vendor/silverstripe/framework/phpcs.xml.dist src/ tests/; fi

after_success:
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml; fi
16 changes: 9 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "silverstripe/segment-field",
"description": "A reusable approach to segment-generating fields",
"type": "silverstripe-module",
"type": "silverstripe-vendormodule",
"keywords": ["silverstripe", "segment"],
"license": "MIT",
"authors": [
Expand All @@ -11,20 +11,22 @@
}
],
"require": {
"silverstripe/framework": "^4.0@dev",
"silverstripe/cms": "^4.0@dev"
"silverstripe/cms": "^4.0"
},
"require-dev": {
"phpunit/phpunit": "^5.7",
"mockery/mockery": "^0.9",
"squizlabs/php_codesniffer": "^3",
"silverstripe/reports": "^4.0@dev",
"silverstripe/siteconfig": "^4.0@dev"
"squizlabs/php_codesniffer": "^3.0",
"silverstripe/reports": "^4.0",
"silverstripe/siteconfig": "^4.0"
},
"extra": {
"branch-alias": {
"dev-master": "2.1.x-dev"
}
},
"expose": [
"client/dist"
]
},
"autoload": {
"psr-4": {
Expand Down
21 changes: 0 additions & 21 deletions phpcs.xml.dist

This file was deleted.

11 changes: 3 additions & 8 deletions src/SegmentField.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,10 @@ public function Preview()
*/
public function Field($properties = array())
{
$module = ModuleLoader::getModule('silverstripe/segment-field');

Requirements::javascript('//code.jquery.com/jquery-1.7.2.min.js');
Requirements::javascript(
ModuleLoader::getModule('silverstripe/admin')
->getRelativeResourcePath('thirdparty/jquery-entwine/dist/jquery.entwine-dist.js')
);
Requirements::javascript($module->getRelativeResourcePath('client/dist/js/segment-field.js'));
Requirements::css($module->getRelativeResourcePath('client/dist/styles/segment-field.css'));
Requirements::javascript('silverstripe/admin:thirdparty/jquery-entwine/dist/jquery.entwine-dist.js');
Requirements::javascript('silverstripe/segment-field:client/dist/js/segment-field.js');
Requirements::css('silverstripe/segment-field:client/dist/styles/segment-field.css');

return parent::Field($properties);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/SegmentFieldModifier/IDSegmentFieldModifierTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class IDSegmentFieldModifierTest extends SapphireTest
/**
* @inheritdoc
*/
public function tearDown()
protected function tearDown()
{
Mockery::close();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class SlugSegmentFieldModifierTest extends SapphireTest
/**
* @inheritdoc
*/
public function tearDown()
protected function tearDown()
{
Mockery::close();

Expand Down
2 changes: 1 addition & 1 deletion tests/SegmentFieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class SegmentFieldTest extends SapphireTest
/**
* @inheritdoc
*/
public function tearDown()
protected function tearDown()
{
Mockery::close();

Expand Down

0 comments on commit fe7550a

Please sign in to comment.