fail('An expected Exception has not been raised.'); } private function removeWhiteSpace ($string) { $str = preg_replace("/\>(\s)+\<", trim($string)); // $str = preg_replace("/\\n/", "\\n", $str); return $str; } public function testInvalidOperator () { try { $filter = new OgcFilter("gsdfhj", "a", "b", new WfsConfiguration()); } catch (Exception $e) { return; } $this->fail('An expected Exception has not been raised.'); } public function testInvalidWfsConf () { try { $filter = new OgcFilter("Intersects", "a", 3, null); } catch (Exception $e) { return; } $this->fail('An expected Exception has not been raised.'); } public function testPropertyIsLike () { $filter = new OgcFilter("LIKE", "a", "3*"); $expected = << a 3* FILTER; $this->assertEquals($this->removeWhiteSpace($expected), $this->removeWhiteSpace($filter->toXml())); } public function testPropertyIsLikeAnd () { $filter1 = new OgcFilter("LIKE", "a", "3*"); $filter2 = new OgcFilter("LIKE", "b", "*asd"); $filter = new OgcFilter("AND", array($filter1, $filter2)); $expected = << a 3* b *asd FILTER; $this->assertEquals($this->removeWhiteSpace($expected), $this->removeWhiteSpace($filter->toXml())); } // this test is not operational /* public function testOperatorIntersects () { $geoJson = << topp:the_geom 28,-38 31,-38 31,-41 28,-41 28,-38 FILTER; // $this->assertEquals($filterXml, $filter->toXml()); } */ } ?>