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]); }
public function testAddBookmarkAddsToQueue() { $pockpack_q = new Duellsy\Pockpack\PockpackQueue(); $pockpack_q->add(array('url' => 'http://www.example.com')); $this->assertEquals(1, sizeof($pockpack_q->getActions())); }
/** * @expectedException Duellsy\Pockpack\NoItemException */ public function testNoItemExceptionWhenAdding() { $pockpack_q = new Duellsy\Pockpack\PockpackQueue(); $pockpack_q->add(array('item_id' => 123)); }