Пример #1
0
   public function testParseFailure()
   {
       $item = json_decode('{
   "Name":"SVG_FileLog_SHCdev_60_1",
   "PossibleSets":"copyGplotFile:noArg",
   "PossibleAttrs":"verbose:0,1,2,3,4,5 room group comment alias eventMap userReadings fixedoffset fixedrange startDate plotsize nrAxis endPlotNow endPlotToday label title plotfunction captionLeft:1,0 DbLogExclude devStateIcon devStateStyle icon sortby webCmd widgetOverride userattr",
   "Internals": {
     "DEF": "FileLog_SHCdev_60:SVG_FileLog_SHCdev_60_1:CURRENT",
     "GPLOTFILE": "SVG_FileLog_SHCdev_60_1",
     "LOGDEVICE": "FileLog_SHCdev_60",
     "LOGFILE": "CURRENT",
     "NAME": "SVG_FileLog_SHCdev_60_1",
     "NR": "244",
     "STATE": "initialized",
     "TYPE": "SVG"
   },
   "Readings": {
   },
   "Attributes": {
     "room": "1.2_Arbeitszimmer,Arbeitszimmer,testroom2"
   }
 }');
       $deviceFactoryMock = m::mock(DeviceFactory::class);
       $deviceFactoryMock->shouldReceive('hasDevice')->with('SVG')->andReturn(false);
       $parser = new DeviceParser($deviceFactoryMock);
       $result = $parser->parse($item);
       $this->assertFalse($result);
   }