Code Duplication    Length = 10-13 lines in 8 locations

src/Component/Storage/Tests/Model/DoctrineStorageTest.php 4 locations

@@ 47-56 (lines=10) @@
44
        $this->assertInstanceOf(StorageInterface::class, $this->doctrineCacheStorage);
45
    }
46
47
    public function testOffsetExists()
48
    {
49
        $this->cache
50
            ->expects($this->once())
51
            ->method('contains')
52
            ->with($this->identicalTo($offset = 'foo'))
53
            ->will($this->returnValue(true));
54
55
        $this->assertTrue(isset($this->doctrineCacheStorage[$offset]));
56
    }
57
58
    public function testOffsetExistsWithExistentEntry()
59
    {
@@ 58-67 (lines=10) @@
55
        $this->assertTrue(isset($this->doctrineCacheStorage[$offset]));
56
    }
57
58
    public function testOffsetExistsWithExistentEntry()
59
    {
60
        $this->cache
61
            ->expects($this->once())
62
            ->method('fetch')
63
            ->with($this->identicalTo($offset = 'foo'))
64
            ->will($this->returnValue($value = 'bar'));
65
66
        $this->assertSame($value, $this->doctrineCacheStorage[$offset]);
67
    }
68
69
    public function testOffsetExistsWithNonexistentEntry()
70
    {
@@ 69-78 (lines=10) @@
66
        $this->assertSame($value, $this->doctrineCacheStorage[$offset]);
67
    }
68
69
    public function testOffsetExistsWithNonexistentEntry()
70
    {
71
        $this->cache
72
            ->expects($this->once())
73
            ->method('fetch')
74
            ->with($this->identicalTo($offset = 'foo'))
75
            ->will($this->returnValue(false));
76
77
        $this->assertNull($this->doctrineCacheStorage[$offset]);
78
    }
79
80
    public function testOffsetSet()
81
    {
@@ 80-91 (lines=12) @@
77
        $this->assertNull($this->doctrineCacheStorage[$offset]);
78
    }
79
80
    public function testOffsetSet()
81
    {
82
        $this->cache
83
            ->expects($this->once())
84
            ->method('save')
85
            ->with(
86
                $this->identicalTo($offset = 'foo'),
87
                $this->identicalTo($value = 'bar')
88
            );
89
90
        $this->doctrineCacheStorage[$offset] = $value;
91
    }
92
93
    public function testOffsetUnset()
94
    {

src/Component/Storage/Tests/Model/SessionStorageTest.php 1 location

@@ 58-70 (lines=13) @@
55
        $this->assertTrue(isset($this->sessionStorage[$offset]));
56
    }
57
58
    public function testOffsetGet()
59
    {
60
        $this->session
61
            ->expects($this->once())
62
            ->method('get')
63
            ->with(
64
                $this->identicalTo($offset = 'foo'),
65
                $this->isNull()
66
            )
67
            ->will($this->returnValue($value = 'bar'));
68
69
        $this->assertSame($value, $this->sessionStorage[$offset]);
70
    }
71
72
    public function testOffsetSet()
73
    {

src/Component/Grid/Tests/DataSource/Doctrine/ORM/ExpressionBuilderTest.php 3 locations

@@ 181-190 (lines=10) @@
178
        $this->assertSame($expression, $this->builder->gte($x, $y));
179
    }
180
181
    public function testExists()
182
    {
183
        $this->expr
184
            ->expects($this->once())
185
            ->method('exists')
186
            ->with($this->identicalTo($x = 'property'))
187
            ->will($this->returnValue($expression = 'expression'));
188
189
        $this->assertSame($expression, $this->builder->exists($x));
190
    }
191
192
    public function testIn()
193
    {
@@ 220-229 (lines=10) @@
217
        $this->assertSame($expression, $this->builder->notIn($x, $y));
218
    }
219
220
    public function testIsNull()
221
    {
222
        $this->expr
223
            ->expects($this->once())
224
            ->method('isNull')
225
            ->with($this->identicalTo($x = 'property'))
226
            ->will($this->returnValue($expression = 'expression'));
227
228
        $this->assertSame($expression, $this->builder->isNull($x));
229
    }
230
231
    public function testIsNotNull()
232
    {
@@ 231-240 (lines=10) @@
228
        $this->assertSame($expression, $this->builder->isNull($x));
229
    }
230
231
    public function testIsNotNull()
232
    {
233
        $this->expr
234
            ->expects($this->once())
235
            ->method('isNotNull')
236
            ->with($this->identicalTo($x = 'property'))
237
            ->will($this->returnValue($expression = 'expression'));
238
239
        $this->assertSame($expression, $this->builder->isNotNull($x));
240
    }
241
242
    public function testLike()
243
    {