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