1 | <?php |
||
13 | abstract class DispatchableSerializerTest extends PHPUnit_Framework_TestCase { |
||
14 | |||
15 | /** |
||
16 | * @return DispatchableSerializer |
||
17 | */ |
||
18 | protected abstract function buildSerializer(); |
||
19 | |||
20 | public function testImplementsDispatchableSerializerInterface() { |
||
23 | |||
24 | /** |
||
25 | * @dataProvider serializableProvider |
||
26 | */ |
||
27 | public function testIsSerializerForReturnsTrue( $serializable ) { |
||
30 | |||
31 | /** |
||
32 | * @return array[] things that are serialized by the serializer |
||
33 | */ |
||
34 | public abstract function serializableProvider(); |
||
35 | |||
36 | /** |
||
37 | * @dataProvider nonSerializableProvider |
||
38 | */ |
||
39 | public function testIsSerializerForReturnsFalse( $nonSerializable ) { |
||
42 | |||
43 | /** |
||
44 | * @dataProvider nonSerializableProvider |
||
45 | */ |
||
46 | public function testSerializeThrowsUnsupportedObjectException( $nonSerializable ) { |
||
50 | |||
51 | /** |
||
52 | * @return array[] things that aren't serialized by the serializer |
||
53 | */ |
||
54 | public abstract function nonSerializableProvider(); |
||
55 | |||
56 | /** |
||
57 | * @dataProvider serializationProvider |
||
58 | */ |
||
59 | public function testSerialization( $serialization, $object ) { |
||
62 | |||
63 | /** |
||
64 | * @return array[] an array of array( serialization, object to serialize) |
||
65 | */ |
||
66 | public abstract function serializationProvider(); |
||
67 | |||
68 | } |
||
69 |