*/ \Murphy\Test::add(function ($runner) { \Murphy\Fixture::load(dirname(__FILE__) . '/../on_clause.class.php.murphy/fixture.php')->execute(); $conn = new Connection('localhost', 'plusql', 'plusql', 'plusql'); $conn->connect(); $query = new Query('SELECT * FROM strong_guy', $conn->link()); try { $iterator = new QueryIterator($query, 'weak_guy'); $runner->fail('Why did the QueryIterator with query that only contained strong_guy not throw an exception when used to access weak_guy?'); } catch (InvalidQueryRowException $exc) { $runner->pass(); } $iterator = new QueryIterator($query, 'strong_guy'); $pairs = array('strong_guy_id' => 1); $iterator->constrainKeys($pairs); $iterator->checkConstraints(); $wrong_pair = array('non_existant' => 1); $iterator->constrainKeys($wrong_pair); try { $iterator->checkConstraints(); $runner->fail('Why was I able to constrain an iterator for strong_guy to a field non_existant?'); } catch (InvalidQueryRowException $exc) { $runner->pass(); } $wrong_paid = array('strong_guy_id' => 2); $iterator->constrainKeys($wrong_pair); try { $iterator->checkConstraints(); $runner->fail('Why was I able to constrain an iterator for strong_guy to value that should be wrong?'); } catch (InvalidQueryRowException $exc) { $runner->pass();