コード例 #1
0
 /**
  * @depends testConstructor
  */
 public function testSettersGetters()
 {
     $unitUnderTest = new PropertyMetadata('testProperty');
     $this->assertEquals(false, $unitUnderTest->isExpose());
     $unitUnderTest->setExpose(true);
     $this->assertEquals(true, $unitUnderTest->isExpose());
     $unitUnderTest->setSerializedName('serialized');
     $this->assertEquals('serialized', $unitUnderTest->getSerializedName());
     $unitUnderTest->setType('string');
     $this->assertEquals('string', $unitUnderTest->getType());
     $unitUnderTest->setGroups(array('string', 'test'));
     $this->assertCount(2, $unitUnderTest->getGroups());
     $this->assertEquals(array('string', 'test'), $unitUnderTest->getGroups());
 }
コード例 #2
0
 /**
  * @param PropertyMetadata $property
  * @return bool
  */
 public function shouldSkip(PropertyMetadata $property)
 {
     if (!$property->isExpose()) {
         return true;
     }
     foreach ($this->specifications as $specification) {
         if ($specification->isSatisfiedBy($property)) {
             return true;
         }
     }
     return false;
 }