Skip to content

Commit

Permalink
REFACTOR - remove AddressData and Distance DataExtensions
Browse files Browse the repository at this point in the history
migrate to dynamic/silverstripe-geocoder

closes #171
  • Loading branch information
jsirish committed Sep 27, 2017
1 parent 5d4e576 commit c3542d4
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 237 deletions.
56 changes: 17 additions & 39 deletions .travis.yml
@@ -1,55 +1,33 @@

language: php

sudo: false

addons:
apt:
packages:
- tidy

before_install:
- pip install --user codecov

env:
global:
- DB=MYSQL CORE_RELEASE=4.0
- MODULE_PATH=locator
- COVERAGE=0
- COMPOSER_ROOT_VERSION=4.0.x-dev
- CODECOV_TOKEN=
- SCRUT_TOKEN=

matrix:
include:
- php: 7.0
env: DB=SQLITE
- php: 7.0
env: DB=PGSQL
- php: 7.0
env: COVERAGE=1
- php: 5.6
allow_failures:
env: DB=MYSQL PHPCS_TEST=1 PHPUNIT_TEST=1
- php: 7.0
env: DB=SQLITE

env: DB=MYSQL PHPUNIT_TEST=1
- php: 7.1
env: DB=MYSQL PHPUNIT_COVERAGE_TEST=1

before_script:
# Init PHP
- phpenv rehash
- composer self-update || true
- git clone git://github.com/silverstripe-labs/silverstripe-travis-support.git ~/travis-support
- php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss
- cd ~/builds/ss
- mv "$MODULE_PATH/phpunit.xml.dist" .
- phpenv config-rm xdebug.ini
- echo 'memory_limit = 2048M' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini

#Execute tests with or without coverage
script:
# Execute tests with no coverage. This is the fastest option
- "if [ \"$COVERAGE\" = \"0\" ]; then vendor/bin/phpunit $MODULE_PATH/tests/; fi"
# Install composer dependencies
- composer require --prefer-dist --no-update silverstripe-themes/simple:~3.2
- composer update --no-suggest --prefer-dist

# Execute tests with coverage. Do this for a small
- "if [ \"$COVERAGE\" = \"1\" ]; then vendor/bin/phpunit --coverage-clover=coverage.clover $MODULE_PATH/tests/; fi"
script:
- if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit; fi
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage.xml && wget https://scrutinizer-ci.com/ocular.phar; fi

# Upload code coverage when tests pass
after_success:
- "if [ \"$COVERAGE\" = \"1\" ]; then mv coverage.clover ~/build/$TRAVIS_REPO_SLUG/; fi"
- cd ~/build/$TRAVIS_REPO_SLUG
- wget https://scrutinizer-ci.com/ocular.phar
- "if [ \"$COVERAGE\" = \"1\" ]; then travis_retry codecov && travis_retry php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi"
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml -t $CODECOV_TOKEN && travis_retry php ocular.phar code-coverage:upload --format=php-clover --access-token=$SCRUT_TOKEN coverage.xml; fi
4 changes: 2 additions & 2 deletions _config/config.yml
Expand Up @@ -3,6 +3,6 @@ Name: locator
---
Dynamic\Locator\Location:
extensions:
- Dynamic\Locator\DistanceDataExtension
- Dynamic\Locator\AddressDataExtension
- Dynamic\SilverStripeGeocoder\DistanceDataExtension
- Dynamic\SilverStripeGeocoder\AddressDataExtension
- SilverStripe\Versioned\Versioned('Stage','Live')
9 changes: 7 additions & 2 deletions composer.json
Expand Up @@ -20,12 +20,17 @@
}
],
"require": {
"silverstripe/framework": "^4.0",
"silverstripe/cms": "^4.0",
"silverstripe/recipe-cms": "^1.0",
"muskie9/data-to-arraylist": "^2.0",
"dynamic/silverstripe-geocoder": "^1.0",
"symbiote/silverstripe-gridfieldextensions": "^3.0"
},
"require-dev": {
"phpunit/PHPUnit": "^5.7"
},
"config": {
"process-timeout": 600
},
"suggest": {
"unclecheese/betterbuttons": "Adds new form actions and buttons to GridField detail form for usability enhancements.",
"unclecheese/bootstrap-forms": "Allows the creation of forms compatible with the Twitter Bootstrap CSS framework in SilverStripe."
Expand Down
8 changes: 4 additions & 4 deletions phpunit.xml.dist
@@ -1,13 +1,13 @@
<phpunit bootstrap="framework/tests/bootstrap.php" colors="true">
<phpunit bootstrap="cms/tests/bootstrap.php" colors="true">
<testsuite name="locator">
<directory>locator/tests</directory>
<directory>tests</directory>
</testsuite>

<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">locator/src/</directory>
<directory suffix=".php">src/</directory>
<exclude>
<directory suffix=".php">locator/tests/</directory>
<directory suffix=".php">tests/</directory>
</exclude>
</whitelist>
</filter>
Expand Down
106 changes: 0 additions & 106 deletions src/extensions/AddressDataExtension.php

This file was deleted.

37 changes: 0 additions & 37 deletions src/extensions/DistanceDataExtension.php

This file was deleted.

43 changes: 0 additions & 43 deletions tests/AddressDataExtensionTest.php

This file was deleted.

2 changes: 1 addition & 1 deletion tests/LocationCategoryTest.php
Expand Up @@ -17,7 +17,7 @@ class LocationCategoryTest extends SapphireTest
/**
* @var string
*/
protected static $fixture_file = 'locator/tests/fixtures.yml';
protected static $fixture_file = 'fixtures.yml';

/**
*
Expand Down
2 changes: 1 addition & 1 deletion tests/LocationTest.php
Expand Up @@ -16,7 +16,7 @@ class LocationTest extends SapphireTest
/**
* @var string
*/
protected static $fixture_file = 'locator/tests/fixtures.yml';
protected static $fixture_file = 'fixtures.yml';

/**
*
Expand Down
2 changes: 1 addition & 1 deletion tests/LocatorFormTest.php
Expand Up @@ -14,7 +14,7 @@ class LocatorFormTest extends FunctionalTest
/**
* @var string
*/
protected static $fixture_file = 'locator/tests/fixtures.yml';
protected static $fixture_file = 'fixtures.yml';

/**
*
Expand Down
2 changes: 1 addition & 1 deletion tests/LocatorTest.php
Expand Up @@ -17,7 +17,7 @@ class LocatorTest extends FunctionalTest
/**
* @var string
*/
protected static $fixture_file = 'locator/tests/fixtures.yml';
protected static $fixture_file = 'fixtures.yml';

/**
*
Expand Down

0 comments on commit c3542d4

Please sign in to comment.