/** * Creates a person object for Testing. * * @return Alpha\Model\Person * * @since 2.0 */ private function createPersonObject($name) { $person = new Person(); $person->setDisplayname($name); $person->set('email', $name . '@test.com'); $person->set('password', 'passwordTest'); $person->set('URL', 'http://unitTestUser/'); return $person; }
/** * Testing the deleteAllByAttribute method. * * @since 1.0 * @dataProvider getActiveRecordProviders */ public function testDeleteAllByAttribute($provider) { $config = ConfigProvider::getInstance(); $config->set('db.provider.name', $provider); $person1 = new Person(); $person1->setDisplayname('unitTestUser1'); $person1->set('email', '*****@*****.**'); $person1->set('password', 'passwordTest'); $person1->set('URL', 'http://unitTestUser/'); $person2 = new Person(); $person2->setDisplayname('unitTestUser2'); $person2->set('email', '*****@*****.**'); $person2->set('password', 'passwordTest'); $person2->set('URL', 'http://unitTestUser/'); $person3 = new Person(); $person3->setDisplayname('unitTestUser3'); $person3->set('email', '*****@*****.**'); $person3->set('password', 'passwordTest'); $person3->set('URL', 'http://unitTestUser/'); $person1->save(); $person2->save(); $person3->save(); $this->assertEquals(3, $this->person->deleteAllByAttribute('URL', 'http://unitTestUser/'), 'Testing the deleteAllByAttribute method'); }