We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| @@ 269-280 (lines=12) @@ | ||
| 266 | /** |
|
| 267 | * transcript of JS implementation test : works with a just-right array slice. |
|
| 268 | */ |
|
| 269 | public function testWorksWithAJustRightArraySlice() |
|
| 270 | { |
|
| 271 | $actual = ConnectionBuilder::connectionFromArraySlice( |
|
| 272 | array_slice($this->letters, 1, 2), // equals to letters.slice(1,3) in JS |
|
| 273 | ['first' => 2, 'after' => 'YXJyYXljb25uZWN0aW9uOjA='], |
|
| 274 | ['sliceStart' => 1, 'arrayLength' => 5] |
|
| 275 | ); |
|
| 276 | ||
| 277 | $expected = $this->getExpectedConnection(['B', 'C'], false, true); |
|
| 278 | ||
| 279 | $this->assertEquals($expected, $actual); |
|
| 280 | } |
|
| 281 | ||
| 282 | /** |
|
| 283 | * transcript of JS implementation test : works with an oversized array slice ("left" side). |
|
| @@ 285-296 (lines=12) @@ | ||
| 282 | /** |
|
| 283 | * transcript of JS implementation test : works with an oversized array slice ("left" side). |
|
| 284 | */ |
|
| 285 | public function testWorksWithAnOversizedArraySliceLeftSide() |
|
| 286 | { |
|
| 287 | $actual = ConnectionBuilder::connectionFromArraySlice( |
|
| 288 | array_slice($this->letters, 0, 3), // equals to letters.slice(0,3) in JS |
|
| 289 | ['first' => 2, 'after' => 'YXJyYXljb25uZWN0aW9uOjA='], |
|
| 290 | ['sliceStart' => 0, 'arrayLength' => 5] |
|
| 291 | ); |
|
| 292 | ||
| 293 | $expected = $this->getExpectedConnection(['B', 'C'], false, true); |
|
| 294 | ||
| 295 | $this->assertEquals($expected, $actual); |
|
| 296 | } |
|
| 297 | ||
| 298 | /** |
|
| 299 | * transcript of JS implementation test : works with an oversized array slice ("right" side). |
|
| @@ 301-312 (lines=12) @@ | ||
| 298 | /** |
|
| 299 | * transcript of JS implementation test : works with an oversized array slice ("right" side). |
|
| 300 | */ |
|
| 301 | public function testWorksWithAnOversizedArraySliceRightSide() |
|
| 302 | { |
|
| 303 | $actual = ConnectionBuilder::connectionFromArraySlice( |
|
| 304 | array_slice($this->letters, 2, 2), // equals to letters.slice(2,4) in JS |
|
| 305 | ['first' => 1, 'after' => 'YXJyYXljb25uZWN0aW9uOjE='], |
|
| 306 | ['sliceStart' => 2, 'arrayLength' => 5] |
|
| 307 | ); |
|
| 308 | ||
| 309 | $expected = $this->getExpectedConnection(['C'], false, true); |
|
| 310 | ||
| 311 | $this->assertEquals($expected, $actual); |
|
| 312 | } |
|
| 313 | ||
| 314 | /** |
|
| 315 | * transcript of JS implementation test : works with an oversized array slice (both sides). |
|
| @@ 317-328 (lines=12) @@ | ||
| 314 | /** |
|
| 315 | * transcript of JS implementation test : works with an oversized array slice (both sides). |
|
| 316 | */ |
|
| 317 | public function testWorksWithAnOversizedArraySliceBothSides() |
|
| 318 | { |
|
| 319 | $actual = ConnectionBuilder::connectionFromArraySlice( |
|
| 320 | array_slice($this->letters, 1, 3), // equals to letters.slice(1,4) in JS |
|
| 321 | ['first' => 1, 'after' => 'YXJyYXljb25uZWN0aW9uOjE='], |
|
| 322 | ['sliceStart' => 1, 'arrayLength' => 5] |
|
| 323 | ); |
|
| 324 | ||
| 325 | $expected = $this->getExpectedConnection(['C'], false, true); |
|
| 326 | ||
| 327 | $this->assertEquals($expected, $actual); |
|
| 328 | } |
|
| 329 | ||
| 330 | /** |
|
| 331 | * transcript of JS implementation test : works with an undersized array slice ("left" side). |
|
| @@ 333-344 (lines=12) @@ | ||
| 330 | /** |
|
| 331 | * transcript of JS implementation test : works with an undersized array slice ("left" side). |
|
| 332 | */ |
|
| 333 | public function testWorksWithAnUndersizedArraySliceLeftSide() |
|
| 334 | { |
|
| 335 | $actual = ConnectionBuilder::connectionFromArraySlice( |
|
| 336 | array_slice($this->letters, 3, 2), // equals to letters.slice(3,5) in JS |
|
| 337 | ['first' => 3, 'after' => 'YXJyYXljb25uZWN0aW9uOjE='], |
|
| 338 | ['sliceStart' => 3, 'arrayLength' => 5] |
|
| 339 | ); |
|
| 340 | ||
| 341 | $expected = $this->getExpectedConnection(['D', 'E'], false, false); |
|
| 342 | ||
| 343 | $this->assertEquals($expected, $actual); |
|
| 344 | } |
|
| 345 | ||
| 346 | /** |
|
| 347 | * transcript of JS implementation test : works with an undersized array slice ("right" side). |
|
| @@ 349-360 (lines=12) @@ | ||
| 346 | /** |
|
| 347 | * transcript of JS implementation test : works with an undersized array slice ("right" side). |
|
| 348 | */ |
|
| 349 | public function testWorksWithAnUndersizedArraySliceRightSide() |
|
| 350 | { |
|
| 351 | $actual = ConnectionBuilder::connectionFromArraySlice( |
|
| 352 | array_slice($this->letters, 2, 2), // equals to letters.slice(2,4) in JS |
|
| 353 | ['first' => 3, 'after' => 'YXJyYXljb25uZWN0aW9uOjE='], |
|
| 354 | ['sliceStart' => 2, 'arrayLength' => 5] |
|
| 355 | ); |
|
| 356 | ||
| 357 | $expected = $this->getExpectedConnection(['C', 'D'], false, true); |
|
| 358 | ||
| 359 | $this->assertEquals($expected, $actual); |
|
| 360 | } |
|
| 361 | ||
| 362 | /** |
|
| 363 | * transcript of JS implementation test : works with an undersized array slice (both sides). |
|
| @@ 365-376 (lines=12) @@ | ||
| 362 | /** |
|
| 363 | * transcript of JS implementation test : works with an undersized array slice (both sides). |
|
| 364 | */ |
|
| 365 | public function worksWithAnUndersizedArraySliceBothSides() |
|
| 366 | { |
|
| 367 | $actual = ConnectionBuilder::connectionFromArraySlice( |
|
| 368 | array_slice($this->letters, 3, 1), // equals to letters.slice(3,4) in JS |
|
| 369 | ['first' => 3, 'after' => 'YXJyYXljb25uZWN0aW9uOjE='], |
|
| 370 | ['sliceStart' => 3, 'arrayLength' => 5] |
|
| 371 | ); |
|
| 372 | ||
| 373 | $expected = $this->getExpectedConnection(['D'], false, true); |
|
| 374 | ||
| 375 | $this->assertEquals($expected, $actual); |
|
| 376 | } |
|
| 377 | ||
| 378 | public function testReturnsAnEdgesCursorGivenAnArrayAndAMemberObject() |
|
| 379 | { |
|