/** * Creates a basic ClassObject instance, and sets the config properties on the class * @param \ReflectionClass $class The reflected class to create the ClassObject instance from * @return ClassObject */ protected function createClassObject(\ReflectionClass $class) { $classObject = new ClassObject(); /** @var MarshallConfig $config */ $config = $this->reader->getClassAnnotation($class, '\\PhpJsonMarshaller\\Annotations\\MarshallConfig'); if (isset($config)) { if ($config->validate()) { $classObject->setIgnoreUnknown($config->canIgnoreUnknown()); } } return $classObject; }
public function testIgnoreUnknown() { $classObject = new ClassObject(); $classObject->setIgnoreUnknown(true); $this->assertEquals(true, $classObject->canIgnoreUnknown()); }