Skip to content

Commit

Permalink
Merge branch '2.2' into 2.3
Browse files Browse the repository at this point in the history
* 2.2:
  [Locale] fixed build-data exit code in case of an error
  fixed request format of sub-requests when explicitely set by the developer (closes #8787)
  Sets _format attribute only if it wasn't set previously by the user.
  Exclude little words of 'ee' to 'oo' plural transformation
  fixed the format of the request used to render an exception
  Fix typo in the check_path validator
  added a missing use statement (closes #8808)
  fix for Process:isSuccessful()

Conflicts:
	UPGRADE-3.0.md
	src/Symfony/Component/Locale/Resources/data/build-data.php
  • Loading branch information
fabpot committed Aug 22, 2013
2 parents a49d145 + e4a89b7 commit 1e91553
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ public function getExitCodeText()
*/
public function isSuccessful()
{
return 0 == $this->getExitCode();
return 0 === $this->getExitCode();
}

/**
Expand Down
12 changes: 12 additions & 0 deletions Tests/AbstractProcessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,18 @@ public function testIsSuccessful()
$this->assertTrue($process->isSuccessful());
}

public function testIsSuccessfulOnlyAfterTerminated()
{
$process = $this->getProcess('sleep 1');
$process->start();
while ($process->isRunning()) {
$this->assertFalse($process->isSuccessful());
usleep(300000);
}

$this->assertTrue($process->isSuccessful());
}

public function testIsNotSuccessful()
{
$process = $this->getProcess('php -r "sleep(4);"');
Expand Down
8 changes: 8 additions & 0 deletions Tests/SigchildDisabledProcessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ public function testIsSuccessful()
parent::testIsSuccessful();
}

/**
* @expectedException \Symfony\Component\Process\Exception\RuntimeException
*/
public function testIsSuccessfulOnlyAfterTerminated()
{
parent::testIsSuccessfulOnlyAfterTerminated();
}

/**
* @expectedException \Symfony\Component\Process\Exception\RuntimeException
*/
Expand Down

0 comments on commit 1e91553

Please sign in to comment.