Skip to content

Commit

Permalink
Merge pull request #21 from OpenBuildings/tests-update
Browse files Browse the repository at this point in the history
Update tests configuration
  • Loading branch information
hkdobrev authored Aug 27, 2016
2 parents 2dbcc8d + e26af01 commit f31e21c
Show file tree
Hide file tree
Showing 11 changed files with 107 additions and 25 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@

/vendor/
/build/

# Local configuration
/phpunit.xml
20 changes: 13 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ php:
- 5.4
- 5.5
- 5.6
- 7
- 7.0
- 7.1
- hhvm

env:
Expand All @@ -17,6 +18,11 @@ env:

matrix:
fast_finish: true
allow_failures:
- php: 7.1
env: DEPS=normal
- php: 7.1
env: DEPS=highest
exclude:
- php: 5.3
env: DEPS=highest
Expand All @@ -38,12 +44,12 @@ notifications:
slack:
secure: ixWu6kWtNIlzzdImpu4MdvGYpA6ZPp/dQpMAp6FDO2oHHB55J9ossBYtVtBXPCDs9OxqfQl2yqbE+TkhfIfkZqIbhvX2+CiIomvYSKZDvryUlCfbfV29behmSVIVYvg3b8Tba+nAyZeJA2guUyAy02WGr3n4I+PDgZC3Wa/mv94=

before_install: composer selfupdate
before_install: travis_retry composer selfupdate

install:
- if [ "$DEPS" = "normal" ]; then composer install --no-interaction; fi;
- if [ "$DEPS" = "highest" ]; then composer update --no-interaction; fi;
- if [ "$DEPS" = "lowest" ]; then composer update --no-interaction --prefer-lowest --prefer-stable; fi;
- if [ "$DEPS" = "normal" ]; then travis_retry composer install --no-interaction; fi;
- if [ "$DEPS" = "highest" ]; then travis_retry composer update --no-interaction; fi;
- if [ "$DEPS" = "lowest" ]; then travis_retry composer update --no-interaction --prefer-lowest --prefer-stable; fi;

before_script:
- mkdir -p build/logs
Expand All @@ -56,5 +62,5 @@ script:
- vendor/bin/phpunit --stop-on-error --stop-on-failure --coverage-clover build/logs/clover.xml

after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml
- travis_retry wget https://scrutinizer-ci.com/ocular.phar
- travis_retry php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"openbuildings/environment-backup": "~0.1.1"
},
"require-dev": {
"openbuildings/kohana-test-bootsrap": "~0.1.2",
"openbuildings/kohana-test-bootstrap": "^0.2",
"se/selenium-server-standalone": "2.40",
"phpunit/phpunit": "^4.0|^5.0"
},
Expand Down
88 changes: 76 additions & 12 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
2 changes: 1 addition & 1 deletion src/Openbuildings/Spiderling/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public function click($id)
* @param array $query
* @return $this
*/
public function visit($uri, array $query = NULL)
public function visit($uri, array $query = array())
{
throw new Exception_Notimplemented(__FUNCTION__, $this);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Openbuildings/Spiderling/Driver/Phantomjs.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public function click($id)
* @param string $uri
* @param array $query
*/
public function visit($uri, array $query = NULL)
public function visit($uri, array $query = array())
{
$query = array_merge((array) $this->_next_query, (array) $query);

Expand Down
2 changes: 1 addition & 1 deletion src/Openbuildings/Spiderling/Driver/Selenium.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ public function click($id)
* @param string $uri
* @param array $query
*/
public function visit($uri, array $query = NULL)
public function visit($uri, array $query = array())
{
$query = array_merge((array) $this->_next_query, (array) $query);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ public function current_path();

public function user_agent();

public function execute($method, $url, array $post = NULL);
public function execute($method, $url, array $post = array());
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function current_path()
* @param array $post
* @return string
*/
public function execute($method, $url, array $post = NULL)
public function execute($method, $url, array $post = array())
{
$curl = curl_init($url);

Expand Down
9 changes: 9 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@

define('TESTVIEWS', realpath(__DIR__.DIRECTORY_SEPARATOR.'views').DIRECTORY_SEPARATOR);

Kohana::$config->load('url')->set('trusted_hosts', array('example.com'));

// Set a default route
Route::set('default', '(<controller>(/<action>(/<id>)))')
->defaults(array(
'controller' => 'test',
'action' => 'index',
));

Kohana::modules(array(
'spiderling' => __DIR__.'/..',
));
Expand Down

0 comments on commit f31e21c

Please sign in to comment.