/** * @covers \Weasel\JsonMarshaller\Config\Annotations\JsonSubTypes\Type */ public function testParsePropertyAnnotations() { $rClass = new \ReflectionClass('\\Weasel\\JsonMarshaller\\Config\\Annotations\\JsonSubTypes\\Type'); $annotationReader = new \Weasel\Annotation\AnnotationReader($rClass, new \Weasel\Annotation\AnnotationConfigurator()); $found = array(); foreach ($rClass->getProperties() as $property) { $name = $property->getName(); $found[$name] = $annotationReader->getPropertyAnnotations($name); } $this->assertEquals(array("value" => array(), "name" => array()), $found); }
/** * @covers \Weasel\JsonMarshaller\Config\Annotations\JsonInclude */ public function testParsePropertyAnnotations() { $rClass = new \ReflectionClass('\\Weasel\\JsonMarshaller\\Config\\Annotations\\JsonInclude'); $annotationReader = new \Weasel\Annotation\AnnotationReader($rClass, new \Weasel\Annotation\AnnotationConfigurator()); $found = array(); foreach ($rClass->getProperties() as $property) { $name = $property->getName(); $found[$name] = $annotationReader->getPropertyAnnotations($name); } $expectedEnumInclude = new \Weasel\Annotation\Config\Annotations\Enum("Include"); $this->assertEquals(array("enumInclude" => array('\\Weasel\\Annotation\\Config\\Annotations\\Enum' => array($expectedEnumInclude)), "value" => array()), $found); }
/** * @covers \Weasel\JsonMarshaller\Config\Annotations\JsonTypeInfo */ public function testParsePropertyAnnotations() { $rClass = new \ReflectionClass('\\Weasel\\JsonMarshaller\\Config\\Annotations\\JsonTypeInfo'); $annotationReader = new \Weasel\Annotation\AnnotationReader($rClass, new \Weasel\Annotation\AnnotationConfigurator()); $found = array(); foreach ($rClass->getProperties() as $property) { $name = $property->getName(); $found[$name] = $annotationReader->getPropertyAnnotations($name); } $expectedEnumId = new \Weasel\Annotation\Config\Annotations\Enum("Id"); $expectedEnumAs = new \Weasel\Annotation\Config\Annotations\Enum("As"); $this->assertEquals(array("enumId" => array('\\Weasel\\Annotation\\Config\\Annotations\\Enum' => array($expectedEnumId)), "enumAs" => array('\\Weasel\\Annotation\\Config\\Annotations\\Enum' => array($expectedEnumAs)), "use" => array(), "include" => array(), "property" => array(), "visible" => array(), "defaultImpl" => array()), $found); }