public function testSendSMS() { $command = new Command(); $command->sendSMS('123', 'Some Message'); // Get the commands $commands = $command->all(); $this->assertCount(2, $commands); $this->assertEquals('AT+CMGS="123"', $commands[0][ATCommandInterface::EXE]); $this->assertEquals('Some Message', $commands[1][ATCommandInterface::EXE]); }
public function testRunValidService() { $dsn = "dio.serial:///dev/ttyUSB0"; $session = new Session($dsn); $command = new Command(); $command->setSMSTextMode(); $command->sendSMS('085648721439', 'Foo Bar'); $command->readSMS(ATCommandInterface::TYPE_ALL); $service = new Service($session, $command); $this->assertInstanceOf('\\Pintu\\DIOServiceInterface', $service); $service->run(); }