Skip to content
This repository has been archived by the owner on Jun 18, 2019. It is now read-only.

Commit

Permalink
V7 (#317)
Browse files Browse the repository at this point in the history
* Updated composer

* Fixing tests

* Updated ci tests

* Updated ci tests

* fixed tests migrations
  • Loading branch information
dimsav authored Jan 29, 2017
1 parent b5c38c6 commit 1528422
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 18 deletions.
10 changes: 1 addition & 9 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,7 @@ test:
override:
# turn xdebug off
- mv /opt/circleci/php/$(phpenv global)/etc/conf.d/xdebug.ini /opt/circleci/php/$(phpenv global)/etc/conf.d/xdebug.ini_disabled
- composer require illuminate/support:"5.3.*" --prefer-source --no-interaction
# turn xdebug on
- mv /opt/circleci/php/$(phpenv global)/etc/conf.d/xdebug.ini_disabled /opt/circleci/php/$(phpenv global)/etc/conf.d/xdebug.ini
- phpunit
- rm -rf vendor composer.lock
- git checkout -- composer.json
# turn xdebug off
- mv /opt/circleci/php/$(phpenv global)/etc/conf.d/xdebug.ini /opt/circleci/php/$(phpenv global)/etc/conf.d/xdebug.ini_disabled
- composer require illuminate/support:"5.2.*" illuminate/database:"5.2.*" --prefer-source --no-interaction
- composer install --prefer-source --no-interaction
# turn xdebug on
- mv /opt/circleci/php/$(phpenv global)/etc/conf.d/xdebug.ini_disabled /opt/circleci/php/$(phpenv global)/etc/conf.d/xdebug.ini
- phpunit --coverage-clover=coverage.clover
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
],
"require": {
"php": ">=5.4.0",
"illuminate/support": "~5.1"
"illuminate/support": "5.4.*"
},
"require-dev": {
"orchestra/testbench": "~3.0",
"phpunit/phpunit": "~4.0"
"orchestra/testbench": "3.4.*",
"phpunit/phpunit": "~5.7"
},
"autoload": {
"psr-4": {
Expand Down
8 changes: 4 additions & 4 deletions tests/TestCoreModelExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public function test_it_returns_false_if_exists_and_dirty_and_parent_save_return
{
$that = $this;
$event = App::make('events');
$event->listen('eloquent*', function ($model) use ($that) {
return get_class($model) == 'Dimsav\Translatable\Test\Model\Country' ? false : true;
$event->listen('eloquent*', function ($event, $models) use ($that) {
return get_class(reset($models)) == 'Dimsav\Translatable\Test\Model\Country' ? false : true;
});

$country = Country::find(1);
Expand All @@ -78,8 +78,8 @@ public function test_it_returns_false_if_does_not_exist_and_parent_save_returns_
{
$that = $this;
$event = App::make('events');
$event->listen('eloquent*', function ($model) use ($that) {
return get_class($model) == 'Dimsav\Translatable\Test\Model\Continent' ? false : true;
$event->listen('eloquent*', function ($event, $models) use ($that) {
return get_class(reset($models)) == 'Dimsav\Translatable\Test\Model\Continent' ? false : true;
});

$continent = new Continent();
Expand Down
4 changes: 2 additions & 2 deletions tests/TestsBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ private function makeSureDatabaseExists()

private function makeSureSchemaIsCreated()
{
$migrationsPath = __DIR__.'/migrations';
$migrationsPath = '../../../../tests/migrations';
$artisan = $this->app->make('Illuminate\Contracts\Console\Kernel');

// Makes sure the migrations table is created
$artisan->call('migrate', [
'--database' => 'mysql',
'--realpath' => $migrationsPath,
'--path' => $migrationsPath,
]);
}

Expand Down

0 comments on commit 1528422

Please sign in to comment.