/** * Test modify version */ public function testModify() { $code = file_get_contents(__DIR__ . '/../../src/Command/ReleaseCommand.php'); $modifier = new ConstantModifier($code); $newCode = $modifier->modify('VERSION', '1.0.0'); $this->assertRegExp('/const VERSION = \'1.0.0\';/', $newCode); }
/** * Updates the version constant in $content * * @param string $base64Content * @return string */ private function updateVersionNumber($base64Content, $newVersion) { $code = base64_decode($base64Content); $modifier = new ConstantModifier($code); return $modifier->modify($this->versionConstant, $newVersion); }