コード例 #1
0
ファイル: CallDirectionTest.php プロジェクト: antrampa/crm
 /**
  * @dataProvider getSetDataProvider
  */
 public function testGetSet($property, $value, $expected)
 {
     $directionName = 'forward';
     $obj = new CallDirection($directionName);
     $this->assertEquals($directionName, $obj->getName());
     call_user_func_array(array($obj, 'set' . ucfirst($property)), array($value));
     $this->assertEquals($expected, call_user_func_array(array($obj, 'get' . ucfirst($property)), array()));
 }
コード例 #2
0
 /**
  * @param ObjectManager $manager
  */
 public function load(ObjectManager $manager)
 {
     foreach ($this->data as $name => $label) {
         $callDirection = new CallDirection($name);
         $callDirection->setLabel($label);
         $manager->persist($callDirection);
     }
     $manager->flush();
 }