Completed
Pull Request — master (#335)
by Simon
04:45
created

SupplierConditionTest::test_it_can_be_created()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 7
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
/**
3
 * (c) shopware AG <[email protected]>
4
 * For the full copyright and license information, please view the LICENSE
5
 * file that was distributed with this source code.
6
 */
7
8
namespace ShopwarePlugins\Connect\Tests\Unit\Bundle\SearchBundle\Condition;
9
10
use Assert\InvalidArgumentException;
11
use Shopware\Bundle\SearchBundle\ConditionInterface;
12
use ShopwarePlugins\Connect\Bundle\SearchBundle\Condition\SupplierCondition;
13
use ShopwarePlugins\Connect\Tests\AbstractConnectUnitTest;
14
15
class SupplierConditionTest extends AbstractConnectUnitTest
16
{
17
    public function test_it_can_be_created()
18
    {
19
        $condition = new SupplierCondition([]);
20
21
        $this->assertInstanceOf(SupplierCondition::class, $condition);
22
        $this->assertInstanceOf(ConditionInterface::class, $condition);
23
    }
24
25
    public function test_it_should_only_accept_integer()
26
    {
27
        $condition = new SupplierCondition([ "1" ]);
28
29
        $this->assertInstanceOf(SupplierCondition::class, $condition);
30
        $this->assertInstanceOf(ConditionInterface::class, $condition);
31
    }
32
33
    public function test_it_should_throw_exception_if_non_intergish_values_are_given()
34
    {
35
        Shopware()->Container();
36
        $this->expectException(InvalidArgumentException::class);
37
        new SupplierCondition([ "asdfasdf" ]);
38
    }
39
}