function test_addWhereSearch() { $user = new tests_Common(TABLE_USER); $user->removeAll(); $user->add(array('name' => 'Wolfram Kriesing')); $user->add(array('name' => 'WOLFRAM Daniel KrIESIng')); $user->add(array('name' => ' kriesing wolfram ')); $user->setWhere(); $user->addWhereSearch('name', 'Wolfram Kriesing'); $this->assertEquals(2, $user->getCount(), 'getCount(): Did not find the inserted number of user names.'); $user->add(array('name' => 'Wolfram and here goes some string Kriesing but it should be found')); $user->add(array('name' => '%Wolfram man in the middle :-) Kriesing and smthg behind%')); $this->assertEquals(4, $user->getCount(), 'getCount(): Did not find the inserted number of user names.'); $user->removeAll(); }
function setUp() { foreach ($GLOBALS['allTables'] as $aTable) { $tableObj = new tests_Common($aTable); $tableObj->removeAll(); } $this->setLooselyTyped(true); }