Exemplo n.º 1
0
 /**
  * testAddDevice method
  *
  * @return void
  */
 public function testAddDevice()
 {
     $m2x = $this->generateMockM2X();
     $m2x->request->expects($this->once())->method('request')->with($this->equalTo('POST'), $this->equalTo('https://api-m2x.att.com/v2/distributions/ce21d58783bd50c4e4dc04919d01e81b/devices'), $this->equalTo(array()), $this->equalTo(array('serial' => 'foobar')))->willReturn(new Att\M2X\HttpResponse($this->_raw('distributions_add_device_success')));
     $distribution = new Distribution($m2x, array('id' => 'ce21d58783bd50c4e4dc04919d01e81b'));
     $result = $distribution->addDevice('foobar');
     $this->assertInstanceOf('\\Att\\M2X\\Device', $result);
     $this->assertEquals('foobar', $result->serial);
 }
Exemplo n.º 2
0
 /**
  * Create a new distribution.
  *
  * @link https://m2x.att.com/developer/documentation/v2/distribution#Create-Distribution
  *
  * @param array $data
  * @return Distribution
  */
 public function createDistribution($data)
 {
     return Distribution::create($this, $data);
 }