Esempio n. 1
0
 /**
  * @covers ::__construct
  * @covers ::setProperties
  * @covers ::addProperty
  * @covers ::getProperties
  * @covers ::isFiltered
  */
 public function testSetProperties()
 {
     $filter = new Allowed(['A', 'B']);
     $filter->setProperties(['B', 'C']);
     static::assertTrue($filter->isFiltered('A'));
     static::assertFalse($filter->isFiltered('B'));
     static::assertFalse($filter->isFiltered('C'));
 }
Esempio n. 2
0
 /**
  * @covers ::format
  */
 public function testPropertyFilter()
 {
     $properties = ['Alpha' => 'false', 'Beta' => 'true'];
     $propertyFilter = new Allowed();
     $propertyFilter->addProperty('Alpha');
     $formatter = new Formatter();
     $formatter->setPropertyFilter($propertyFilter);
     $result = $formatter->format($properties);
     static::assertObjectNotHasAttribute('Beta', $result);
 }