Esempio n. 1
0
 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()));
 }
Esempio n. 2
0
 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]);
 }
Esempio n. 3
0
 /**
  * @expectedException Duellsy\Pockpack\InvalidItemTypeException
  */
 public function testInvalidItemTypeException()
 {
     $pockpack_q = new Duellsy\Pockpack\PockpackQueue();
     $pockpack_q->favorite("abc");
 }