public function testReturnsPendingAsIteratorTypeObject() { $t1 = new puzzle_adapter_Transaction(new puzzle_Client(), new puzzle_message_Request('GET', 'http://t.com')); $t2 = new puzzle_adapter_Transaction(new puzzle_Client(), new puzzle_message_Request('GET', 'http://t.com')); $t3 = new puzzle_adapter_Transaction(new puzzle_Client(), new puzzle_message_Request('GET', 'http://t.com')); $iter = new ArrayIterator(array($t1, $t2, $t3)); $b = new puzzle_adapter_curl_BatchContext('foo', false, $iter); $this->assertTrue($b->hasPending()); $this->assertSame($t1, $b->nextPending()); $this->assertTrue($b->hasPending()); $this->assertSame($t2, $b->nextPending()); $this->assertTrue($b->hasPending()); $this->assertSame($t3, $b->nextPending()); $this->assertFalse($b->hasPending()); $this->assertNull($b->nextPending()); }