public function test_filter_posts_results()
 {
     $connection = new O2O_Mock_Connection('test', 'post', 'page');
     $this->connection_factory->add($connection);
     $query_vars = array('o2o_query' => array('connection' => 'test', 'direction' => 'to', 'id' => 1));
     $query = new WP_Query();
     $query->query_vars = $query_vars;
     $o2o_query = new O2O_Query($this->connection_factory);
     $o2o_query->_action_parse_query($query);
     //required for other filters to work properly
     $o2o_query->_filter_posts_results(array(), $query);
     $this->assertTrue(O2O_Mock_Query_Modifier::wasCalled('posts_results'));
 }
 /**
  * @covers ::_action_parse_query
  */
 public function test_action_parse_query()
 {
     $connection = new O2O_Mock_Connection('test', 'post', 'page');
     $connection_factory = new O2O_Connection_Factory();
     $connection_factory->add($connection);
     $query_vars = array('o2o_query' => array('connection' => 'test', 'direction' => 'to', 'id' => 1));
     $query = new WP_Query();
     $query->query_vars = $query_vars;
     $o2o_query = new O2O_Query($connection_factory);
     $o2o_query->_action_parse_query($query);
     $this->assertTrue(O2O_Mock_Query_Modifier::wasCalled('parse_query'));
     $this->assertObjectHasAttribute('o2o_connection', $query);
     $this->assertEquals('test', $query->o2o_connection);
 }