Skip to content

Commit

Permalink
Upgrade kununu/data-fixtures to version 2.0.0 (#5)
Browse files Browse the repository at this point in the history
* Upgrade kununu/data-fixtures to version 2.0.0

* Add cheap test

* Assert types of compiler passses added
  • Loading branch information
TheBay0r authored Aug 8, 2019
1 parent 3981746 commit 0f2c3a3
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"require": {
"php": "^7.2",
"symfony/framework-bundle": "^4.3",
"kununu/data-fixtures": "^1.0.1",
"kununu/data-fixtures": "^2.0.0",
"symfony/config": "^4.3",
"symfony/dependency-injection": "^4.3",
"symfony/http-kernel": "^4.3"
Expand Down
2 changes: 1 addition & 1 deletion tests/App/Fixtures/Connection/ConnectionSqlFixture1.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

final class ConnectionSqlFixture1 extends ConnectionSqlFixture
{
protected function filesName(): array
protected function fileNames(): array
{
return [
__DIR__ . '/Sql/fixture1.sql',
Expand Down
36 changes: 36 additions & 0 deletions tests/KununuTestingBundleTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php declare(strict_types=1);

namespace Kununu\TestingBundle\Tests;

use Kununu\TestingBundle\DependencyInjection\Compiler\CachePoolCompilerPass;
use Kununu\TestingBundle\DependencyInjection\Compiler\DoctrineCompilerPass;
use Kununu\TestingBundle\KununuTestingBundle;
use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;

final class KununuTestingBundleTest extends TestCase
{
public function testBuild()
{
$containerMock = $this->getMockBuilder(ContainerBuilder::class)->getMock();
$containerMock
->expects($this->exactly(2))
->method('addCompilerPass')
->withConsecutive(
[
$this->callback(function($subject) {
return $subject instanceof CachePoolCompilerPass;
}),
],
[
$this->callback(function($subject) {
return $subject instanceof DoctrineCompilerPass;
}),
]
);

$bundle = new KununuTestingBundle();

$bundle->build($containerMock);
}
}

0 comments on commit 0f2c3a3

Please sign in to comment.