/** * @test */ public function shouldReplaceKeyIfExist() { $this->manipulatorStub->contents = <<<CRON headers # KEY key1 value 1 # END no key # KEY key2 # must be replaced # END # KEY key3 foo # END CRON; $cron = new Cron(); $cron->comment('replace'); $this->updater->updateWith($cron, 'key2'); $expectedCron = <<<CRON headers # KEY key1 value 1 # END no key # KEY key2 #replace # END # KEY key3 foo # END CRON; $this->assertEquals($expectedCron, $this->manipulatorStub->contents); }