Example #1
0
 /**
  * testDevices method
  *
  * @return void
  */
 public function testDevices()
 {
     $m2x = $this->generateMockM2X();
     $m2x->request->expects($this->once())->method('request')->with($this->equalTo('GET'), $this->equalTo('https://api-m2x.att.com/v2/distributions/ce21d58783bd50c4e4dc04919d01e81b/devices'))->willReturn(new Att\M2X\HttpResponse($this->_raw('distributions_devices_success')));
     $distribution = new Distribution($m2x, array('id' => 'ce21d58783bd50c4e4dc04919d01e81b'));
     $result = $distribution->devices();
     $this->assertInstanceOf('\\Att\\M2X\\DeviceCollection', $result);
     $this->assertCount(2, $result);
     $this->assertSame($distribution, $result->parent);
 }