コード例 #1
0
ファイル: Test.php プロジェクト: nayjest/manipulator
 /**
  * @depends testInstantiateWithoutArguments
  * @param PersonStruct $person
  * @return PersonStruct
  */
 public function testSetValuesMixed(PersonStruct $person)
 {
     $email = '*****@*****.**';
     $someProp = 'test';
     $gender = 'm';
     $assigned = mp\setValues($person, compact('email', 'someProp', 'gender'));
     self::assertEquals($email, $person->getEmail());
     self::assertEquals($gender, $person->gender);
     self::assertFalse(property_exists($person, 'someProp'));
     self::assertCount(2, $assigned);
     return $person;
 }
コード例 #2
0
ファイル: Builder.php プロジェクト: nayjest/builder
 /**
  * Assigns public properties
  * and properties with setters to target class instance.
  *
  * @param Scaffold $scaffold
  */
 protected function assignProperties(Scaffold $scaffold)
 {
     $scaffold->properties = array_merge($scaffold->input, $scaffold->properties);
     mp\setValues($scaffold->instance, $scaffold->properties);
 }