This repository was archived by the owner on Jan 31, 2020. It is now read-only.
File tree 3 files changed +70
-0
lines changed
3 files changed +70
-0
lines changed Original file line number Diff line number Diff line change @@ -34,4 +34,26 @@ public function testDeprecatedHydratorInterfaceIsAcceptedByMethodsTypehintedWith
34
34
$ hydratorInjected ->setHydrator ($ hydrator );
35
35
$ this ->assertSame ($ hydrator , $ hydratorInjected ->hydrator );
36
36
}
37
+
38
+ public function testDeprecatedHydratorInterfaceIsAcceptedByMethodsTypehintedWithDeprecatedHydrationInterface ()
39
+ {
40
+ $ hydratorInjected = new TestAsset \HydratorInjectedObjectUsingDeprecatedHydrationInterfaceTypehint ();
41
+ $ hydrator = new TestAsset \DeprecatedInterfaceHydrator ();
42
+ set_error_handler (function ($ errno , $ errstr ) {
43
+ $ this ->fail ('Catchable fatal error was triggered: ' . $ errstr );
44
+ }, E_RECOVERABLE_ERROR );
45
+ $ hydratorInjected ->setHydrator ($ hydrator );
46
+ $ this ->assertSame ($ hydrator , $ hydratorInjected ->hydrator );
47
+ }
48
+
49
+ public function testDeprecatedHydratorInterfaceIsAcceptedByMethodsTypehintedWithDeprecatedExtractionInterface ()
50
+ {
51
+ $ hydratorInjected = new TestAsset \HydratorInjectedObjectUsingDeprecatedExtractionInterfaceTypehint ();
52
+ $ hydrator = new TestAsset \DeprecatedInterfaceHydrator ();
53
+ set_error_handler (function ($ errno , $ errstr ) {
54
+ $ this ->fail ('Catchable fatal error was triggered: ' . $ errstr );
55
+ }, E_RECOVERABLE_ERROR );
56
+ $ hydratorInjected ->setExtractor ($ hydrator );
57
+ $ this ->assertSame ($ hydrator , $ hydratorInjected ->extractor );
58
+ }
37
59
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * @see http://github.com/zendframework/zend-stdlib for the canonical source repository
4
+ * @copyright Copyright (c) 2015 Zend Technologies USA Inc. (http://www.zend.com)
5
+ * @license https://github.com/zendframework/zend-stdlib/blob/master/LICENSE.md New BSD License
6
+ */
7
+
8
+ namespace ZendTest \Stdlib \TestAsset ;
9
+
10
+ use Zend \Stdlib \Extractor \ExtractionInterface ;
11
+
12
+ /**
13
+ * This test asset exists to see how deprecation works; it is associated with
14
+ * the test ZendTest\Stdlib\HydratorDeprecationTest.
15
+ */
16
+ class HydratorInjectedObjectUsingDeprecatedExtractionInterfaceTypehint
17
+ {
18
+ public $ extractor ;
19
+
20
+ public function setExtractor (ExtractionInterface $ extractor )
21
+ {
22
+ $ this ->extractor = $ extractor ;
23
+ }
24
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * @see http://github.com/zendframework/zend-stdlib for the canonical source repository
4
+ * @copyright Copyright (c) 2015 Zend Technologies USA Inc. (http://www.zend.com)
5
+ * @license https://github.com/zendframework/zend-stdlib/blob/master/LICENSE.md New BSD License
6
+ */
7
+
8
+ namespace ZendTest \Stdlib \TestAsset ;
9
+
10
+ use Zend \Stdlib \Hydrator \HydrationInterface ;
11
+
12
+ /**
13
+ * This test asset exists to see how deprecation works; it is associated with
14
+ * the test ZendTest\Stdlib\HydratorDeprecationTest.
15
+ */
16
+ class HydratorInjectedObjectUsingDeprecatedHydrationInterfaceTypehint
17
+ {
18
+ public $ hydrator ;
19
+
20
+ public function setHydrator (HydrationInterface $ hydrator )
21
+ {
22
+ $ this ->hydrator = $ hydrator ;
23
+ }
24
+ }
You can’t perform that action at this time.
0 commit comments