Code Duplication    Length = 14-17 lines in 5 locations

Tests/Units/ArrayCollection/ArrayListTests.php 1 location

@@ 67-83 (lines=17) @@
64
    /*
65
     * Test contains.
66
     */
67
    public function testContains()
68
    {
69
        $this
70
            ->given(
71
                $unique = $this->uniqueValue(),
72
                $collection = $this->randomCollection()
73
            )
74
            ->then()
75
                ->boolean($collection->contains($unique))
76
                    ->isFalse()
77
            ->and
78
            ->when($collection->add($unique))
79
            ->then()
80
                ->boolean($collection->contains($unique))
81
                    ->isTrue()
82
        ;
83
    }
84
85
    /*
86
     * Test removeAt.

Tests/Units/ArrayCollection/ArraySetTests.php 1 location

@@ 68-84 (lines=17) @@
65
    /*
66
     * Test contains.
67
     */
68
    public function testContains()
69
    {
70
        $this
71
            ->given(
72
                $unique = $this->uniqueValue(),
73
                $collection = $this->randomCollection()
74
            )
75
            ->then()
76
                ->boolean($collection->contains($unique))
77
                    ->isFalse()
78
            ->and
79
            ->when($collection->add($unique))
80
            ->then()
81
                ->boolean($collection->contains($unique))
82
                    ->isTrue()
83
        ;
84
    }
85
86
    /*
87
     * Test containsAll.

Tests/Units/ListTestCase.php 1 location

@@ 53-66 (lines=14) @@
50
    /**
51
     * Test add.
52
     */
53
    public function testAdd()
54
    {
55
        $this
56
            ->given($collection = $this->randomCollection())
57
            ->and($unique = $this->uniqueValue())
58
            ->and($count = $collection->count())
59
            ->when($collection->add($unique))
60
            ->then()
61
                ->list($collection)
62
                    ->contains($unique)
63
                    ->size()
64
                        ->isEqualTo($count + 1)
65
        ;
66
    }
67
68
    /**
69
     * Test add.

Tests/Units/SetTestCase.php 1 location

@@ 70-83 (lines=14) @@
67
    /**
68
     * Test add.
69
     */
70
    public function testAdd()
71
    {
72
        $this
73
            ->given($collection = $this->emptyCollection())
74
            ->and($unique = $this->uniqueValue())
75
            ->when($collection->add($unique))
76
            ->and($collection->add($unique))
77
            ->then()
78
                ->set($collection)
79
                    ->contains($unique)
80
                    ->size()
81
                        ->isEqualTo(1)
82
        ;
83
    }
84
85
    /**
86
     * Test add.

Tests/Units/ArrayCollection/ArrayHashMapTests.php 1 location

@@ 67-81 (lines=15) @@
64
    /*
65
     * Test get.
66
     */
67
    public function testGet()
68
    {
69
        $this
70
            ->given($collection = $this->randomCollection())
71
            ->and($unique = $this->uniqueValue())
72
            ->then()
73
                ->variable($collection->get('foo'))
74
                    ->isNull()
75
            ->and()
76
            ->when($collection->set('foo', $unique))
77
            ->then()
78
                ->variable($collection->get('foo'))
79
                    ->isEqualTo($unique)
80
        ;
81
    }
82
83
    /*
84
     * Test containsValue.