1717 * @covers \Bolt\PackStream\v1\Unpacker
1818 *
1919 * @package Bolt\tests\PackStream\v1
20- * @requires PHP >= 7.1
21- * @requires extension mbstring
22- * @requires extension json
2320 */
2421class UnpackerTest extends TestCase
2522{
@@ -31,7 +28,6 @@ public function testInit(): AProtocol
3128 $ bolt = new Bolt ($ conn );
3229 $ this ->assertInstanceOf (Bolt::class, $ bolt );
3330
34- /** @var AProtocol|\Bolt\protocol\V4_3|\Bolt\protocol\V4_4 $protocol */
3531 $ protocol = $ bolt ->build ();
3632 $ this ->assertInstanceOf (AProtocol::class, $ protocol );
3733
@@ -43,7 +39,7 @@ public function testInit(): AProtocol
4339
4440 /**
4541 * @depends testInit
46- * @param AProtocol|\Bolt\protocol\V4_3|\Bolt\protocol\V4_4 $protocol
42+ * @param AProtocol $protocol
4743 */
4844 public function testNull (AProtocol $ protocol )
4945 {
@@ -61,7 +57,7 @@ public function testNull(AProtocol $protocol)
6157
6258 /**
6359 * @depends testInit
64- * @param AProtocol|\Bolt\protocol\V4_3|\Bolt\protocol\V4_4 $protocol
60+ * @param AProtocol $protocol
6561 */
6662 public function testBoolean (AProtocol $ protocol )
6763 {
@@ -81,7 +77,7 @@ public function testBoolean(AProtocol $protocol)
8177
8278 /**
8379 * @depends testInit
84- * @param AProtocol|\Bolt\protocol\V4_3|\Bolt\protocol\V4_4 $protocol
80+ * @param AProtocol $protocol
8581 */
8682 public function testInteger (AProtocol $ protocol )
8783 {
@@ -102,7 +98,7 @@ public function testInteger(AProtocol $protocol)
10298
10399 /**
104100 * @depends testInit
105- * @param AProtocol|\Bolt\protocol\V4_3|\Bolt\protocol\V4_4 $protocol
101+ * @param AProtocol $protocol
106102 */
107103 public function testFloat (AProtocol $ protocol )
108104 {
@@ -127,7 +123,7 @@ public function testFloat(AProtocol $protocol)
127123 * @depends testInit
128124 * @dataProvider stringProvider
129125 * @param string $str
130- * @param AProtocol|\Bolt\protocol\V4_3|\Bolt\protocol\V4_4 $protocol
126+ * @param AProtocol $protocol
131127 */
132128 public function testString (string $ str , AProtocol $ protocol )
133129 {
@@ -162,7 +158,7 @@ private function randomString(int $length): string
162158 * @depends testInit
163159 * @dataProvider listProvider
164160 * @param int $size
165- * @param AProtocol|\Bolt\protocol\V4_3|\Bolt\protocol\V4_4 $protocol
161+ * @param AProtocol $protocol
166162 */
167163 public function testList (int $ size , AProtocol $ protocol )
168164 {
@@ -190,10 +186,21 @@ public function listProvider(): \Generator
190186 * @dataProvider dictionaryProvider
191187 * @param string $query
192188 * @param int $size
193- * @param AProtocol|\Bolt\protocol\V4_3|\Bolt\protocol\V4_4 $protocol
189+ * @param AProtocol $protocol
194190 */
195191 public function testDictionary (string $ query , int $ size , AProtocol $ protocol )
196192 {
193+ $ apocRequest = iterator_to_array (
194+ $ protocol
195+ ->run ('SHOW PROCEDURES YIELD name WHERE name STARTS WITH "apoc." RETURN count(*) > 0 AS apoc ' )
196+ ->pull ()
197+ ->getResponses (),
198+ false
199+ );
200+ if (!$ apocRequest [1 ]->getContent ()[0 ]) {
201+ $ this ->markTestSkipped ('Neo4j not running with apoc ' );
202+ }
203+
197204 $ gen = $ protocol
198205 ->run ($ query , [], ['mode ' => 'r ' ])
199206 ->pull ()
@@ -203,6 +210,8 @@ public function testDictionary(string $query, int $size, AProtocol $protocol)
203210 foreach ($ gen as $ response ) {
204211 if ($ response ->getSignature () == Response::SIGNATURE_RECORD ) {
205212 $ this ->assertCount ($ size , $ response ->getContent ()[0 ]);
213+ } elseif ($ response ->getSignature () == Response::SIGNATURE_FAILURE ) {
214+ $ this ->markTestIncomplete (print_r ($ response ->getContent (), true ));
206215 }
207216 }
208217 }
0 commit comments