Skip to content

Commit 4d3ce84

Browse files
committed
CS fixes
1 parent 04fc310 commit 4d3ce84

File tree

3 files changed

+48
-84
lines changed

3 files changed

+48
-84
lines changed

tests/lib/Parameters/ParameterType/ChannelTypeTest.php

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace Netgen\Layouts\Sylius\Tests\Parameters\ParameterType;
66

77
use Netgen\Layouts\Parameters\ParameterDefinition;
8-
use Netgen\Layouts\Parameters\ParameterTypeInterface;
98
use Netgen\Layouts\Sylius\Parameters\ParameterType\ChannelType;
109
use Netgen\Layouts\Sylius\Tests\Stubs\Channel as ChannelStub;
1110
use Netgen\Layouts\Sylius\Tests\Validator\RepositoryValidatorFactory;
@@ -23,9 +22,6 @@ final class ChannelTypeTest extends TestCase
2322
{
2423
use ParameterTypeTestTrait;
2524

26-
/** @var \Netgen\Layouts\Sylius\Parameters\ParameterType\ChannelType */
27-
private ParameterTypeInterface $type;
28-
2925
private MockObject&ChannelRepositoryInterface $repositoryMock;
3026

3127
protected function setUp(): void
@@ -110,30 +106,6 @@ public static function invalidOptionsDataProvider(): iterable
110106
];
111107
}
112108

113-
public function testValueObjectNull(): void
114-
{
115-
$this->repositoryMock
116-
->expects(self::once())
117-
->method('find')
118-
->with(self::identicalTo(null))
119-
->willReturn(null);
120-
121-
self::assertNull($this->type->getValueObject(null));
122-
}
123-
124-
public function testValueObjectIsValidObject(): void
125-
{
126-
$stub = new ChannelStub(1, 'test', 'test');
127-
128-
$this->repositoryMock
129-
->expects(self::once())
130-
->method('find')
131-
->with(self::identicalTo(1))
132-
->willReturn($stub);
133-
134-
self::assertSame($stub, $this->type->getValueObject(1));
135-
}
136-
137109
public function testValidationValid(): void
138110
{
139111
$this->repositoryMock
@@ -196,4 +168,20 @@ public static function emptyDataProvider(): iterable
196168
[new ChannelStub(42, 'WEBSHOP', 'Webshop'), false],
197169
];
198170
}
171+
172+
public function testGetValueObject(): void
173+
{
174+
$stub = new ChannelStub(1, 'test', 'test');
175+
176+
$this->repositoryMock
177+
->expects(self::once())
178+
->method('find')
179+
->with(self::identicalTo(1))
180+
->willReturn($stub);
181+
182+
/** @var \Netgen\Layouts\Sylius\Parameters\ParameterType\ChannelType $type */
183+
$type = $this->type;
184+
185+
self::assertSame($stub, $type->getValueObject(1));
186+
}
199187
}

tests/lib/Parameters/ParameterType/ProductTypeTest.php

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace Netgen\Layouts\Sylius\Tests\Parameters\ParameterType;
66

77
use Netgen\Layouts\Parameters\ParameterDefinition;
8-
use Netgen\Layouts\Parameters\ParameterTypeInterface;
98
use Netgen\Layouts\Sylius\Parameters\ParameterType\ProductType;
109
use Netgen\Layouts\Sylius\Tests\Stubs\Product as ProductStub;
1110
use Netgen\Layouts\Sylius\Tests\Validator\RepositoryValidatorFactory;
@@ -23,9 +22,6 @@ final class ProductTypeTest extends TestCase
2322
{
2423
use ParameterTypeTestTrait;
2524

26-
/** @var \Netgen\Layouts\Sylius\Parameters\ParameterType\ProductType */
27-
private ParameterTypeInterface $type;
28-
2925
private MockObject&ProductRepositoryInterface $repositoryMock;
3026

3127
protected function setUp(): void
@@ -89,30 +85,6 @@ public static function invalidOptionsDataProvider(): iterable
8985
];
9086
}
9187

92-
public function testValueObjectNull(): void
93-
{
94-
$this->repositoryMock
95-
->expects(self::once())
96-
->method('find')
97-
->with(self::identicalTo(null))
98-
->willReturn(null);
99-
100-
self::assertNull($this->type->getValueObject(null));
101-
}
102-
103-
public function testValueObjectIsValidObject(): void
104-
{
105-
$stub = new ProductStub(1);
106-
107-
$this->repositoryMock
108-
->expects(self::once())
109-
->method('find')
110-
->with(self::identicalTo(1))
111-
->willReturn($stub);
112-
113-
self::assertSame($stub, $this->type->getValueObject(1));
114-
}
115-
11688
public function testValidationValid(): void
11789
{
11890
$this->repositoryMock
@@ -175,4 +147,20 @@ public static function emptyDataProvider(): iterable
175147
[new ProductStub(42), false],
176148
];
177149
}
150+
151+
public function testGetValueObject(): void
152+
{
153+
$stub = new ProductStub(1);
154+
155+
$this->repositoryMock
156+
->expects(self::once())
157+
->method('find')
158+
->with(self::identicalTo(1))
159+
->willReturn($stub);
160+
161+
/** @var \Netgen\Layouts\Sylius\Parameters\ParameterType\ProductType $type */
162+
$type = $this->type;
163+
164+
self::assertSame($stub, $type->getValueObject(1));
165+
}
178166
}

tests/lib/Parameters/ParameterType/TaxonTypeTest.php

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace Netgen\Layouts\Sylius\Tests\Parameters\ParameterType;
66

77
use Netgen\Layouts\Parameters\ParameterDefinition;
8-
use Netgen\Layouts\Parameters\ParameterTypeInterface;
98
use Netgen\Layouts\Sylius\Parameters\ParameterType\TaxonType;
109
use Netgen\Layouts\Sylius\Tests\Stubs\Taxon as TaxonStub;
1110
use Netgen\Layouts\Sylius\Tests\Validator\RepositoryValidatorFactory;
@@ -23,9 +22,6 @@ final class TaxonTypeTest extends TestCase
2322
{
2423
use ParameterTypeTestTrait;
2524

26-
/** @var \Netgen\Layouts\Sylius\Parameters\ParameterType\TaxonType */
27-
private ParameterTypeInterface $type;
28-
2925
private MockObject&TaxonRepositoryInterface $repositoryMock;
3026

3127
protected function setUp(): void
@@ -89,30 +85,6 @@ public static function invalidOptionsDataProvider(): iterable
8985
];
9086
}
9187

92-
public function testValueObjectNull(): void
93-
{
94-
$this->repositoryMock
95-
->expects(self::once())
96-
->method('find')
97-
->with(self::identicalTo(null))
98-
->willReturn(null);
99-
100-
self::assertNull($this->type->getValueObject(null));
101-
}
102-
103-
public function testValueObjectIsValidObject(): void
104-
{
105-
$stub = new TaxonStub(1);
106-
107-
$this->repositoryMock
108-
->expects(self::once())
109-
->method('find')
110-
->with(self::identicalTo(1))
111-
->willReturn($stub);
112-
113-
self::assertSame($stub, $this->type->getValueObject(1));
114-
}
115-
11688
public function testValidationValid(): void
11789
{
11890
$this->repositoryMock
@@ -175,4 +147,20 @@ public static function emptyDataProvider(): iterable
175147
[new TaxonStub(42), false],
176148
];
177149
}
150+
151+
public function testGetValueObject(): void
152+
{
153+
$stub = new TaxonStub(1);
154+
155+
$this->repositoryMock
156+
->expects(self::once())
157+
->method('find')
158+
->with(self::identicalTo(1))
159+
->willReturn($stub);
160+
161+
/** @var \Netgen\Layouts\Sylius\Parameters\ParameterType\TaxonType $type */
162+
$type = $this->type;
163+
164+
self::assertSame($stub, $type->getValueObject(1));
165+
}
178166
}

0 commit comments

Comments
 (0)