public function testCallingPockpackClearClearsLocalQueue() { $pockpack_q = new Duellsy\Pockpack\PockpackQueue(); $pockpack_q->favorite(123); $pockpack_q->delete(123); $pockpack_q->clear(); $this->assertEquals(0, sizeof($pockpack_q->getActions())); }
public function testSending() { $response = new Response(200); $response->setBody(json_encode(array('action_results' => array(true), 'status' => 1))); $this->setPocketResponse($response); $pockpack_q = new Duellsy\Pockpack\PockpackQueue(); $pockpack_q->add(array('url' => 'http://www.example.com')); $response = $this->pockpack->send($pockpack_q); $this->assertEquals(1, $response->status); $this->assertCount(1, $response->action_results); $this->assertTrue($response->action_results[0]); }
/** * @expectedException Duellsy\Pockpack\InvalidItemTypeException */ public function testInvalidItemTypeException() { $pockpack_q = new Duellsy\Pockpack\PockpackQueue(); $pockpack_q->favorite("abc"); }