Code Duplication    Length = 10-12 lines in 3 locations

spec/Prophecy/Argument/Token/ExactValueTokenSpec.php 1 location

@@ 126-137 (lines=12) @@
123
        $this->__toString()->shouldReturn('exact(stream:'.$resource.')');
124
    }
125
126
    function it_generates_proper_string_representation_for_object(\stdClass $object)
127
    {
128
        $objHash = sprintf('exact(%s:%s',
129
            get_class($object->getWrappedObject()),
130
            spl_object_hash($object->getWrappedObject())
131
        ) . " Object (\n    'objectProphecyClosure' => Closure:%s Object (\n        0 => Closure:%s Object\n    )\n))";
132
133
        $this->beConstructedWith($object);
134
135
        $hashRegexExpr = '[a-f0-9]{32}';
136
        $this->__toString()->shouldMatch(sprintf('/^%s$/', sprintf(preg_quote("$objHash"), $hashRegexExpr, $hashRegexExpr)));
137
    }
138
}
139
140
class ExactValueTokenFixtureA

spec/Prophecy/Argument/Token/IdenticalValueTokenSpec.php 1 location

@@ 142-153 (lines=12) @@
139
        $this->__toString()->shouldReturn('identical(stream:'.$resource.')');
140
    }
141
142
    function it_generates_proper_string_representation_for_object($object)
143
    {
144
        $objHash = sprintf('identical(%s:%s',
145
            get_class($object->getWrappedObject()),
146
            spl_object_hash($object->getWrappedObject())
147
        ) . " Object (\n    'objectProphecyClosure' => Closure:%s Object (\n        0 => Closure:%s Object\n    )\n))";
148
149
        $this->beConstructedWith($object);
150
151
        $hashRegexExpr = '[a-f0-9]{32}';
152
        $this->__toString()->shouldMatch(sprintf('/^%s$/', sprintf(preg_quote("$objHash"), $hashRegexExpr, $hashRegexExpr)));
153
    }
154
}
155

spec/Prophecy/Util/StringUtilSpec.php 1 location

@@ 72-81 (lines=10) @@
69
        $this->stringify($resource)->shouldReturn('stream:'.$resource);
70
    }
71
72
    function it_generates_proper_string_representation_for_object(\stdClass $object)
73
    {
74
        $objHash = sprintf('%s:%s',
75
            get_class($object->getWrappedObject()),
76
            spl_object_hash($object->getWrappedObject())
77
        ) . " Object (\n    'objectProphecyClosure' => Closure:%s Object (\n        0 => Closure:%s Object\n    )\n)";
78
79
        $hashRegexExpr = '[a-f0-9]{32}';
80
        $this->stringify($object)->shouldMatch(sprintf('/^%s$/', sprintf(preg_quote("$objHash"), $hashRegexExpr, $hashRegexExpr)));
81
    }
82
83
    function it_generates_proper_string_representation_for_object_without_exporting(\stdClass $object)
84
    {