public function testBindCollection() { $store = new LocalFileStore($this->resourceDir); $files = $store->getFiles('/Orders-ex.*xml/'); // regex, not file glob $collection = new ArrayCollection(); $this->assertEquals(1, count($files)); $this->assertEquals('Orders-example.xml', $files[0]->getName()); $this->responseHandler->bindCollection($files, $collection); $this->assertExampleOrders($collection); $this->assertEquals($files[0], $collection->get(0)->getSourceFile()); $this->assertEquals($files[0], $collection->get(1)->getSourceFile()); }
public function testOrdersFromXml() { $xml = file_get_contents($this->resourceDir . 'Orders-example.xml'); $ordersEl = new SimpleXMLElement($xml); $orders = OrderResponseHandler::ordersFromXml($ordersEl); $this->assertExampleOrders($orders); }