public function testIsFilterValid() { $result = $this->activityManager->isFilterValid('fv01'); $this->assertTrue($result); $result = $this->activityManager->isFilterValid('InvalidFilter'); $this->assertFalse($result); }
public function testQueryForFilter() { $result = $this->activityManager->getQueryForFilter('filter1'); $this->assertEquals(array('`app` = ? and `message` like ?', array('mail', 'ownCloud%')), $result); $result = $this->activityManager->isFilterValid('filter2'); $this->assertFalse($result); }
public function testQueryForFilter() { $this->activityManager->registerExtension(function () { return new SimpleExtension(); }); $result = $this->activityManager->getQueryForFilter('filter1'); $this->assertEquals(array(' and ((`app` = ? and `message` like ?) or (`app` = ? and `message` like ?))', array('mail', 'ownCloud%', 'mail', 'ownCloud%')), $result); $result = $this->activityManager->isFilterValid('filter2'); $this->assertFalse($result); }