'test/error-output-test', 'require' => [ 'civicrm/composer-compile-plugin' => '@dev', ], 'minimum-stability' => 'dev', 'extra' => [ 'compile' => [ [ 'title' => 'Compile first', 'shell' => 'echo MARK: RUN FIRST; [ -n $ERROR_1 ]; exit $ERROR_1', ], [ 'title' => 'Compile second', 'shell' => 'echo MARK: RUN SECOND; [ -n $ERROR_2 ]; exit $ERROR_2', ], [ 'title' => 'Compile third', 'shell' => 'echo MARK: RUN THIRD; [ -n $ERROR_3 ]; exit $ERROR_3', ] ], ], ]; } public static function setUpBeforeClass(): void { parent::setUpBeforeClass(); self::initTestProject(static::getComposerJson()); } /** * Run a successful command, with passthru=always */ public function testPassthruAlways() { $p = PH::runOk('COMPOSER_COMPILE_PASSTHRU=always COMPOSER_COMPILE=1 composer install'); $expectLines = [ "^MARK: RUN FIRST", "^MARK: RUN SECOND", "^MARK: RUN THIRD", ]; $this->assertOutputLines($expectLines, ';^MARK:;', $p->getOutput()); } /** * Run a successful command, with passthru=always */ public function testPassthruNever() { $p = PH::runOk('COMPOSER_COMPILE_PASSTHRU=never COMPOSER_COMPILE=1 composer install'); $expectLines = []; $this->assertOutputLines($expectLines, ';^MARK:;', $p->getOutput()); } /** * Run a successful command, with passthru=always */ public function testPassthruAlwaysWithError() { $p = PH::run('ERROR_2=1 COMPOSER_COMPILE_PASSTHRU=always COMPOSER_COMPILE=1 composer install'); $expectLines = [ "^MARK: RUN FIRST", "^MARK: RUN SECOND", // There's an error, so third task doesn't run. ]; $this->assertOutputLines($expectLines, ';^MARK:;', $p->getOutput()); $this->assertTrue($p->getExitCode() !== 0); } /** * Run a successful command, with passthru=always */ public function testPassthruError() { $p = PH::run('ERROR_2=1 COMPOSER_COMPILE_PASSTHRU=error COMPOSER_COMPILE=1 composer install'); $expectLines = [ // First task succeeds, so it doesn't output details. "^MARK: RUN SECOND", // There's an error, so third task doesn't run. ]; $this->assertOutputLines($expectLines, ';^MARK:;', $p->getOutput()); $this->assertTrue($p->getExitCode() !== 0); } } __halt_compiler();----SIGNATURE:----0YsKEc1hzgaTaVFvfmKphGkLoCXAuPOsis6x65/bHbiQV3GelgqHnlwPA3Wgim8ASfAWOtbeYeZYtwKYXqd0O8Ys/EbscLH8Dy53uzLdMEkmo8b05dsIEORj8WI816LUWJvANkebNWTNUp4k2BNoCu140+cK8fEJ6+xTx9Cq1JFgze/Ca2IA0Nmqv8Q6bO/HusiIQseH9SsJizx4d1UIYf01GNE+az7X7Vj4zIR0s7/Nbes2hFF77lJaXZr/WodSxzK0JxMYd/1BALjoTc+M/cmpQJYRIjVn7soF5N6P/GymqvsMCBnU5i8Hi1nVM3aXo47pC/mh4UzCi4xFGPHpMXI8rQxOyCqlCBhdpOWaHQkRgxR4vvlW/FzoMxxljE7ep/Frnx/Jm2W5qfa88xh1Z81cl4TrE6NP2I2ODIz+mxWBG5GAWh1wz0ZxcD7AMjfcjdVwUWue3BbXO4j9DTBSl/p1QKNRL5S2cZ2GzRS2bNVi63a1VIToYqbPGxl0unqjetbKO4oLOAOGAc79YBMB/G8nXRM1BiDq14RRCgHjnY95gZQkglA2VjFvgl8Ur4c/z3iXnzeVMiUumTBsrp1qMUa8yvx9PEaX88kXbEYnROJ0nkxjGxFCSHNZutngjf18uT5nfGQWfzHaqWwkc0IeaStTiGfeKLpy5BSqtL1dHkU=----ATTACHMENT:----OTA5OTYwMDYyNjAwMTU5NCA1MzY1NzI2MzkzODQ3MzIzIDQ5MTQwNTI1NDI1MDcxNjA=