Permalink
Browse files

added a few tests for Augeas::match()

  • Loading branch information...
1 parent 08fbdb2 commit 4911097abef69b44b0611e756fedd68a76c4b46d @ppadron committed Nov 18, 2009
Showing with 29 additions and 0 deletions.
  1. +29 −0 tests/AugeasMatchTest.php
View
@@ -0,0 +1,29 @@
+<?php
+
+require_once "PHPUnit/Framework/TestCase.php";
+
+class AugeasMatchTest extends PHPUnit_Framework_TestCase
+{
+
+ public function testShouldReturnEmptyArrayIfNoMatch()
+ {
+ $augeas = new Augeas("root");
+ $this->assertEquals(array(), $augeas->match("/files/non_existent_directory"));
+ }
+
+ public function testShoulReturnArrayWithMatches()
+ {
+ $augeas = new Augeas("root");
+ $expectedArray = array("/files/etc/hosts");
+ $this->assertEquals($expectedArray, $augeas->match("/files/etc/*"));
+ }
+
+ public function testShouldThrowExceptionIfPathIsInvalid()
+ {
+ $augeas = new Augeas("root");
+ $this->assertEquals(array(), $augeas->match("OMG TOTALLY INVALID PATH"));
+ }
+
+}
+
+?>

0 comments on commit 4911097

Please sign in to comment.