-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMigratorFactoryTest.php
38 lines (33 loc) · 1.12 KB
/
MigratorFactoryTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/*
* This file is part of the PHPCR Migrations package
*
* (c) Daniel Leech <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPCR\Migrations\Tests\Unit;
use PHPCR\Migrations\Migrator;
use PHPCR\Migrations\MigratorFactory;
use PHPCR\Migrations\VersionCollection;
use PHPCR\Migrations\VersionFinder;
use PHPCR\Migrations\VersionStorage;
use PHPCR\SessionInterface;
use PHPUnit\Framework\TestCase;
class MigratorFactoryTest extends TestCase
{
public function testFactory(): void
{
$storage = $this->createMock(VersionStorage::class);
$finder = $this->createMock(VersionFinder::class);
$finder->expects($this->once())
->method('getCollection')
->willReturn($this->createMock(VersionCollection::class))
;
$session = $this->createMock(SessionInterface::class);
$factory = new MigratorFactory($storage, $finder, $session);
$migrator = $factory->getMigrator();
$this->assertInstanceOf(Migrator::class, $migrator);
}
}