Beispiel #1
0
 public function testItCanSerializeWithCorePropertiesAndLinkedDataContexts()
 {
     $attributes = $this->getJobAttributes();
     $job = new Job($attributes);
     $ref = new \ReflectionClass($job);
     $properties = array_filter($ref->getProperties(), function ($property) {
         return $property->class != 'JobApis\\Jobs\\Client\\Job';
     });
     $toJson = $job->toJson(Job::SERIALIZE_CORE_SCHEMA_LD);
     $json = json_decode($toJson, true);
     $this->assertContains('@context', array_keys($json));
     $this->assertEquals(count($properties) + 2, count($json));
 }