public function testFindPropertySet()
 {
     $method = Inspect::this(self::$entityInitEnabled)->getMethod('findPropertySet');
     $properties = $method->invoke(self::$entityInitEnabled, 'id');
     $this->assertCount(1, $properties);
     $this->assertSame('id', $properties[0]->name());
 }
 /**
  * @param string $data
  */
 public function unserialize($data)
 {
     $properties = (array) Serializer::create(Serializer::TYPE_IGBINARY)->unserialize($data);
     foreach ($properties as $name => $value) {
         Inspect::this($this)->getProperty($name)->setValue($this, $value);
     }
 }
 public function testLongWordsBlockWrapping()
 {
     $word = 'Lopadotemachoselachogaleokranioleipsanodrimhypotrimmatosilphioparaomelitokatakechymenokichlepikossyphophattoperisteralektryonoptekephalliokigklopeleiolagoiosiraiobaphetraganopterygon';
     $wordLength = strlen($word);
     $style = $this->getStyle();
     $inspect = Inspect::this($style);
     $property = $inspect->getProperty('lineLengthMax');
     $maxLineLength = $property->value($style) - 3;
     $this->command->setCode(function (InputInterface $input, OutputInterface $output) use($word) {
         $sfStyle = new StyleWithForcedLineLength($input, $output);
         $sfStyle->block($word, 'CUSTOM', 'fg=white;bg=blue', ' § ', false);
     });
     $this->tester->execute(array(), array('interactive' => false, 'decorated' => false));
     $expectedCount = (int) ceil($wordLength / $maxLineLength) + (int) ($wordLength > $maxLineLength - 5);
     $this->assertSame($expectedCount, substr_count($this->tester->getDisplay(true), ' § '));
 }
 /**
  * @param bool        $qualified
  * @param null|object $instance
  *
  * @return string
  */
 public final function getParentName($qualified = false, $instance = null)
 {
     return Inspect::this(get_parent_class($instance))->name($qualified);
 }