/** * @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; }
/** * 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); }