1 | <?php |
||
13 | abstract class DispatchableDeserializerTest extends PHPUnit_Framework_TestCase { |
||
14 | |||
15 | /** |
||
16 | * @return DispatchableDeserializer |
||
17 | */ |
||
18 | protected abstract function buildDeserializer(); |
||
19 | |||
20 | public function testImplementsDispatchableDeserializerInterface() { |
||
23 | |||
24 | /** |
||
25 | * @dataProvider deserializableProvider |
||
26 | */ |
||
27 | public function testIsDeserializerForReturnsTrue( $deserializable ) { |
||
30 | |||
31 | /** |
||
32 | * @return array[] things that are deserialized by the deserializer |
||
33 | */ |
||
34 | public abstract function deserializableProvider(); |
||
35 | |||
36 | /** |
||
37 | * @dataProvider nonDeserializableProvider |
||
38 | */ |
||
39 | public function testIsDeserializerForReturnsFalse( $nonDeserializable ) { |
||
42 | |||
43 | /** |
||
44 | * @dataProvider nonDeserializableProvider |
||
45 | */ |
||
46 | public function testDeserializeThrowsDeserializationException( $nonDeserializable ) { |
||
51 | |||
52 | /** |
||
53 | * @return array[] things that aren't deserialized by the deserializer |
||
54 | */ |
||
55 | public abstract function nonDeserializableProvider(); |
||
56 | |||
57 | /** |
||
58 | * @dataProvider deserializationProvider |
||
59 | */ |
||
60 | public function testDeserialization( $object, $serialization ) { |
||
63 | |||
64 | /** |
||
65 | * @return array[] an array of array( object deserialized, serialization ) |
||
66 | */ |
||
67 | public abstract function deserializationProvider(); |
||
68 | |||
69 | } |
||
70 |