Completed
Push — scalar-types/fixtures ( 9e7ef5 )
by Kamil
33:42 queued 09:21
created

SuiteLoaderSpec::it_is_initializable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace spec\Sylius\Bundle\FixturesBundle\Loader;
15
16
use PhpSpec\ObjectBehavior;
17
use Prophecy\Argument;
18
use Sylius\Bundle\FixturesBundle\Fixture\FixtureInterface;
19
use Sylius\Bundle\FixturesBundle\Loader\FixtureLoaderInterface;
20
use Sylius\Bundle\FixturesBundle\Loader\SuiteLoader;
21
use Sylius\Bundle\FixturesBundle\Loader\SuiteLoaderInterface;
22
use Sylius\Bundle\FixturesBundle\Suite\SuiteInterface;
23
24
/**
25
 * @author Kamil Kokot <[email protected]>
26
 */
27
final class SuiteLoaderSpec extends ObjectBehavior
28
{
29
    function let(FixtureLoaderInterface $fixtureLoader): void
30
    {
31
        $this->beConstructedWith($fixtureLoader);
32
    }
33
34
    function it_implements_suite_loader_interface(): void
35
    {
36
        $this->shouldImplement(SuiteLoaderInterface::class);
37
    }
38
39
    function it_loads_suite_fixtures(
40
        FixtureLoaderInterface $fixtureLoader,
41
        SuiteInterface $suite,
42
        FixtureInterface $firstFixture,
43
        FixtureInterface $secondFixture
44
    ): void {
45
        $suite->getFixtures()->will(function () use ($firstFixture, $secondFixture) {
46
            yield $firstFixture->getWrappedObject() => ['options 1'];
0 ignored issues
show
Bug introduced by
The method getWrappedObject() does not seem to exist on object<Sylius\Bundle\Fix...xture\FixtureInterface>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
47
            yield $secondFixture->getWrappedObject() => ['options 2'];
0 ignored issues
show
Bug introduced by
The method getWrappedObject() does not seem to exist on object<Sylius\Bundle\Fix...xture\FixtureInterface>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
48
        });
49
50
        $fixtureLoader->load($suite, $firstFixture, ['options 1'])->shouldBeCalled();
51
        $fixtureLoader->load($suite, $secondFixture, ['options 2'])->shouldBeCalled();
52
53
        $this->load($suite);
54
    }
55
}
56