public function testDevice() { $ua = new UserAgent(); $this->assertInstanceOf('UserAgentParser\\Model\\Device', $ua->getDevice()); $mock = self::createMock('UserAgentParser\\Model\\Device'); $ua->setDevice($mock); $this->assertSame($mock, $ua->getDevice()); }