/** * @test */ public function canBatchProcessCommandCollections() { $a = new CommandCollection(); $a->add(new Command('wget', ['http://google.com'])); $b = new CommandCollection(); $b->add(new Command('yum install php')); $b->add(new Command('php', ['-v'])); $batch = new Batch(); $batch->addCommandCollection($a); $batch->addCommandCollection($b); $this->assertNotEmpty($batch->getCommandCollections(), 'Batch should return command collections that were added'); $this->assertCount(2, $batch->getCommandCollections(), 'Batch should have two command collections'); $compiled = $batch->getCompiled(); $this->assertEquals('wget http://google.com; yum install php; php -v;', $compiled, 'Compiled batch is invalid'); }