public function testApplyMultipleFilterOnEmptyString() { $string = new String(''); $this->assertEquals('', $string->applyFilter(new VowelsFilter())->applyFilter(new ReverseFilter())); }
<?php require_once './vendor/autoload.php'; use Dummy\String\Filters\VowelsFilter; use Dummy\String\Filters\ReverseFilter; use Dummy\String\String; if ($argc == 1) { die('Usage: ' . __FILE__ . ' string string string...'); } $input = implode(' ', array_slice($argv, 1, count($argv) - 1)); $c = new String($input); $c->applyFilter(new ReverseFilter())->applyFilter(new VowelsFilter()); echo $c . PHP_EOL;