public function testFileGlob() { $file = dirname(__FILE__) . '/assets/*.txt'; $option = new Option(0); $option->setFileRequirements(true, true); $option->setValue($file); $file1 = dirname(__FILE__) . '/assets/example.txt'; $file2 = dirname(__FILE__) . '/assets/another.txt'; $values = $option->getValue(); $this->assertTrue($option->isFile()); $this->assertCount(2, $values); $this->assertTrue(in_array($file1, $values)); $this->assertTrue(in_array($file2, $values)); }
/** * Test that the needed requirements are met */ public function testOptionRequirementsMet() { $option = new Option('f'); $option->setNeeds('foo'); $neededOption = new Option('foo'); $neededOption->setValue(true); $optionSet = array('foo' => $neededOption); $this->assertTrue($option->hasNeeds($optionSet)); }