| @@ 487-497 (lines=11) @@ | ||
| 484 | ||
| 485 | // Object with both and weak equality |
|
| 486 | $this->assertEquals(2, $o7->size); |
|
| 487 | foreach ($o7->value->contents as $o) { |
|
| 488 | $this->assertContains($o->value->contents, array('value2', 'value3')); |
|
| 489 | ||
| 490 | if ($o->value->contents === 'value2') { |
|
| 491 | $this->assertEquals('$v->{\'0\'}', $o->access_path); |
|
| 492 | $this->assertSame('0', $o->name); |
|
| 493 | } elseif ($o->value->contents === 'value3') { |
|
| 494 | $this->assertEquals('$v->{\'\'}', $o->access_path); |
|
| 495 | $this->assertSame('', $o->name); |
|
| 496 | } |
|
| 497 | } |
|
| 498 | } else { |
|
| 499 | // Object from array |
|
| 500 | $this->assertEquals(1, $o1->size); |
|
| @@ 529-539 (lines=11) @@ | ||
| 526 | ||
| 527 | // Object with both |
|
| 528 | $this->assertEquals(2, $o5->size); |
|
| 529 | foreach ($o5->value->contents as $o) { |
|
| 530 | $this->assertContains($o->value->contents, array('value', 'value2')); |
|
| 531 | ||
| 532 | if ($o->value->contents === 'value') { |
|
| 533 | $this->assertEquals('array_values((array) $v)[0]', $o->access_path); |
|
| 534 | $this->assertSame(0, $o->name); |
|
| 535 | } elseif ($o->value->contents === 'value2') { |
|
| 536 | $this->assertEquals('$v->{\'0\'}', $o->access_path); |
|
| 537 | $this->assertSame('0', $o->name); |
|
| 538 | } |
|
| 539 | } |
|
| 540 | ||
| 541 | // Array with both |
|
| 542 | $this->assertEquals(2, $o6->size); |
|
| @@ 543-553 (lines=11) @@ | ||
| 540 | ||
| 541 | // Array with both |
|
| 542 | $this->assertEquals(2, $o6->size); |
|
| 543 | foreach ($o6->value->contents as $o) { |
|
| 544 | $this->assertContains($o->value->contents, array('value', 'value2')); |
|
| 545 | ||
| 546 | if ($o->value->contents === 'value') { |
|
| 547 | $this->assertEquals('array_values($v)[0]', $o->access_path); |
|
| 548 | $this->assertSame('0', $o->name); |
|
| 549 | } elseif ($o->value->contents === 'value2') { |
|
| 550 | $this->assertEquals('$v[0]', $o->access_path); |
|
| 551 | $this->assertSame(0, $o->name); |
|
| 552 | } |
|
| 553 | } |
|
| 554 | } |
|
| 555 | } |
|
| 556 | ||