-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 3.4: [HttpFoundation] Check file exists before unlink [Console] Fixed #29835: ConfirmationQuestion with default true for answer '0' [Translation] Concatenated translation messages [Form] ensure compatibility with older PHPUnit mocks [Serializer] Docblock about throwing exceptions on serializer [Debug][ErrorHandler] Preserve our error handler when a logger set another one [Form] Changed UrlType input type to text when default_protocol is not null [Bugfix] MemcachedSessionHandler::close() must close connection
- Loading branch information
Showing
36 changed files
with
517 additions
and
345 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/Symfony/Component/Console/Tests/Question/ConfirmationQuestionTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Console\Tests\Question; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use Symfony\Component\Console\Question\ConfirmationQuestion; | ||
|
||
class ConfirmationQuestionTest extends TestCase | ||
{ | ||
/** | ||
* @dataProvider normalizerUsecases | ||
*/ | ||
public function testDefaultRegexUsecases($default, $answers, $expected, $message) | ||
{ | ||
$sut = new ConfirmationQuestion('A question', $default); | ||
|
||
foreach ($answers as $answer) { | ||
$normalizer = $sut->getNormalizer(); | ||
$actual = $normalizer($answer); | ||
$this->assertEquals($expected, $actual, sprintf($message, $answer)); | ||
} | ||
} | ||
|
||
public function normalizerUsecases() | ||
{ | ||
return [ | ||
[ | ||
true, | ||
['y', 'Y', 'yes', 'YES', 'yEs', ''], | ||
true, | ||
'When default is true, the normalizer must return true for "%s"', | ||
], | ||
[ | ||
true, | ||
['n', 'N', 'no', 'NO', 'nO', 'foo', '1', '0'], | ||
false, | ||
'When default is true, the normalizer must return false for "%s"', | ||
], | ||
[ | ||
false, | ||
['y', 'Y', 'yes', 'YES', 'yEs'], | ||
true, | ||
'When default is false, the normalizer must return true for "%s"', | ||
], | ||
[ | ||
false, | ||
['n', 'N', 'no', 'NO', 'nO', 'foo', '1', '0', ''], | ||
false, | ||
'When default is false, the normalizer must return false for "%s"', | ||
], | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/Symfony/Component/Debug/Tests/Fixtures/LoggerThatSetAnErrorHandler.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace Symfony\Component\Debug\Tests\Fixtures; | ||
|
||
use Psr\Log\AbstractLogger; | ||
|
||
class LoggerThatSetAnErrorHandler extends AbstractLogger | ||
{ | ||
public function log($level, $message, array $context = []) | ||
{ | ||
set_error_handler('is_string'); | ||
restore_error_handler(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.