Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes tests so the build can pass #160

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"require-dev": {
"phpunit/phpunit": ">=4.0.0",
"mockery/mockery": ">=0.9.0",
"mockery/mockery": "0.9.0",
"illuminate/cache": ">=4.1.0",
"illuminate/console": ">=4.1.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ function($app) {
);
});

$this->commands('migration.generate');

// Bind the Repository Interface to $app['migrations.repository']
$this->app->bind('Illuminate\Database\Migrations\MigrationRepositoryInterface', function($app) {
return $app['migration.repository'];
});
}
$this->commands('migration.generate');

// Bind the Repository Interface to $app['migrations.repository']
$this->app->bind('Illuminate\Database\Migrations\MigrationRepositoryInterface', function($app) {
return $app['migration.repository'];
});

}

/**
* Bootstrap the application events.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php namespace Xethron\MigrationsGenerator;

use Illuminate\Contracts\Config\Repository;
use Mockery;
use PHPUnit_Framework_TestCase;
use PHPUnit\Framework\TestCase;

class MigrationsGeneratorServiceProviderTest extends PHPUnit_Framework_TestCase {
class MigrationsGeneratorServiceProviderTest extends TestCase {

public function tearDown()
{
Expand All @@ -24,19 +25,11 @@ public function registers_migrations_generator()
'Illuminate\Database\Migrations\MigrationRepositoryInterface',
Mockery::any()
);

$app_mock
->shouldReceive('bind')
->atLeast()->once()
->with(
'migration.generate',
Mockery::any()
);


$app_mock
->shouldReceive('share')
->shouldReceive('singleton')
->atLeast()->once()
->with(
->with('migration.generate',
Mockery::on(function($callback) {
$mock = $this->get_app_mock();

Expand Down Expand Up @@ -99,7 +92,10 @@ public function registers_migrations_generator()

$service_provider_mock
->shouldReceive('commands')
->atLeast()->once();
->atLeast()->once()
->with(
'migration.generate'
);

$service_provider_mock->register();
}
Expand Down Expand Up @@ -165,7 +161,7 @@ protected function get_migration_repository_mock()

protected function get_repository_mock()
{
return Mockery::mock('Illuminate\Config\Repository')
return Mockery::mock('\Illuminate\Contracts\Config\Repository')
->shouldAllowMockingProtectedMethods()
->makePartial();
}
Expand Down
6 changes: 3 additions & 3 deletions tests/Xethron/MigrationsGenerator/MigrationsGeneratorTest.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php namespace Xethron\MigrationsGenerator;

use Mockery;
use PHPUnit_Framework_TestCase;
use PHPUnit\Framework\TestCase;

class MigrationsGeneratorTest extends PHPUnit_Framework_TestCase {
class MigrationsGeneratorTest extends TestCase {

public function tearDown()
{
Expand All @@ -15,6 +15,6 @@ public function tearDown()
*/
public function registers_migrations_generator()
{

$this->markTestSkipped('No tests implemented yet.');
}
}