Skip to content
Snippets Groups Projects
Commit ce035093 authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

hotline#133169: fix command used to send newsletter, php executable is taken from PATH

parent 213b0b7f
2 merge requests!3975Hotline,!3973hotline#133169: fix command used to send newsletter, php executable is taken from PATH
Pipeline #13071 passed with stage
in 51 minutes and 2 seconds
- ticket #133169 : Lettres d'information : Correction de la commande d'envois des lettres d'information.
\ No newline at end of file
......@@ -55,7 +55,7 @@ class Class_Batch_SendNewsletters extends Class_Batch_Abstract {
public function run() {
$shell = '/usr/bin/php -f '
$shell = 'php -f '
. realpath(dirname(__FILE__)) . '/../../../scripts/sendNewsletter.php '
. $this->getExecParams()
. ' > /dev/null & echo $!';
......
......@@ -767,8 +767,9 @@ class Admin_NewsletterControllerSendActionTest
/** @test */
public function shouldHaveCalledCommand() {
$this->assertTrue($this->_command->methodHasBeenCalled('exec'));
public function commandshouldHaveBeenCalledStartingWithPhp() {
$shell = $this->_command->getFirstAttributeForMethodCallAt('exec', 0);
$this->assertEquals(1, preg_match('/^php -f /', $shell));
}
......@@ -851,7 +852,7 @@ class Admin_NewsletterControllerSendActionWithCommandFailureTest extends Admin_N
/** @test */
public function dispatchShouldHaveError() {
$this->assertContains('Unable to run /usr/bin/php -f',
$this->assertContains('Unable to run php -f',
$this->_dispatch->getErrorMessage());
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment