Completed
Push — master ( 93bedd...1719a2 )
by Mikołaj
01:26
created

ShippingGatewaySpec::it_adds_shipping_method()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file has been created by the developers from BitBag.
5
 * Feel free to contact us once you face any issues or want to start
6
 * another great project.
7
 * You can find more information about us on https://bitbag.shop and write us
8
 * an email on [email protected].
9
 */
10
11
declare(strict_types=1);
12
13
namespace spec\BitBag\SyliusShippingExportPlugin\Entity;
14
15
use BitBag\SyliusShippingExportPlugin\Entity\ShippingExportInterface;
16
use BitBag\SyliusShippingExportPlugin\Entity\ShippingGateway;
17
use BitBag\SyliusShippingExportPlugin\Entity\ShippingGatewayInterface;
18
use Doctrine\Common\Collections\Collection;
19
use PhpSpec\ObjectBehavior;
20
use Sylius\Component\Core\Model\ShippingMethodInterface;
21
use Sylius\Component\Resource\Model\ResourceInterface;
22
23
final class ShippingGatewaySpec extends ObjectBehavior
24
{
25
    function it_is_initializable()
0 ignored issues
show
Coding Style Naming introduced by
The method it_is_initializable is not named in camelCase.

This check marks method names that have not been written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes databaseConnectionString.

Loading history...
26
    {
27
        $this->shouldHaveType(ShippingGateway::class);
28
    }
29
30
    function it_is_resource()
0 ignored issues
show
Coding Style Naming introduced by
The method it_is_resource is not named in camelCase.

This check marks method names that have not been written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes databaseConnectionString.

Loading history...
31
    {
32
        $this->shouldImplement(ResourceInterface::class);
33
    }
34
35
    function it_implements_shipping_gateway_interface()
0 ignored issues
show
Coding Style Naming introduced by
The method it_implements_shipping_gateway_interface is not named in camelCase.

This check marks method names that have not been written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes databaseConnectionString.

Loading history...
36
    {
37
        $this->shouldImplement(ShippingGatewayInterface::class);
38
    }
39
40
    function it_returns_array_collection_when_initialized()
0 ignored issues
show
Coding Style Naming introduced by
The method it_returns_array_collection_when_initialized is not named in camelCase.

This check marks method names that have not been written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes databaseConnectionString.

Loading history...
41
    {
42
        $this->getShippingMethods()->shouldHaveType(Collection::class);
43
    }
44
45
    function it_adds_shipping_method(ShippingMethodInterface $shippingMethod)
0 ignored issues
show
Coding Style Naming introduced by
The method it_adds_shipping_method is not named in camelCase.

This check marks method names that have not been written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes databaseConnectionString.

Loading history...
46
    {
47
        $this->addShippingMethod($shippingMethod);
48
49
        $this->getShippingMethods()->first()->shouldReturn($shippingMethod);
50
    }
51
52
    function it_initializes_a_shipping_export_collection_by_default()
0 ignored issues
show
Coding Style Naming introduced by
The method it_initializes_a_shipping_export_collection_by_default is not named in camelCase.

This check marks method names that have not been written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes databaseConnectionString.

Loading history...
53
    {
54
        $this->getShippingExports()->shouldHaveType(Collection::class);
55
    }
56
57
    function it_adds_a_shipping_export(ShippingExportInterface $shippingExport)
0 ignored issues
show
Coding Style Naming introduced by
The method it_adds_a_shipping_export is not named in camelCase.

This check marks method names that have not been written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes databaseConnectionString.

Loading history...
58
    {
59
        $this->addShippingExport($shippingExport);
60
        $this->hasShippingExport($shippingExport)->shouldReturn(true);
61
    }
62
63
    function it_removes_a_shipping_export(ShippingExportInterface $shippingExport)
0 ignored issues
show
Coding Style Naming introduced by
The method it_removes_a_shipping_export is not named in camelCase.

This check marks method names that have not been written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes databaseConnectionString.

Loading history...
64
    {
65
        $this->addShippingExport($shippingExport);
66
        $this->removeShippingExport($shippingExport);
67
68
        $this->hasShippingExport($shippingExport)->shouldReturn(false);
69
    }
70
71
    function it_returns_config_value()
0 ignored issues
show
Coding Style Naming introduced by
The method it_returns_config_value is not named in camelCase.

This check marks method names that have not been written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes databaseConnectionString.

Loading history...
72
    {
73
        $this->setConfig(['foo' => 'bar']);
74
75
        $this->getConfigValue('foo')->shouldReturn('bar');
76
    }
77
78
    function it_throws_error_while_trying_to_access_not_existing_config_value()
0 ignored issues
show
Coding Style Naming introduced by
The method it_throws_error_while_trying_to_access_not_existing_config_value is not named in camelCase.

This check marks method names that have not been written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes databaseConnectionString.

Loading history...
79
    {
80
        $this->setConfig(['foo' => 'bar']);
81
82
        $this->shouldThrow(\InvalidArgumentException::class)->during('getConfigValue', ['bar']);
83
    }
84
}
85