From 4f5b44bd3bd490309eb2ba7b44df4769816ba729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Sat, 3 Aug 2013 19:26:54 +0200 Subject: twig implementation --- .../Component/Form/Tests/Guess/GuessTest.php | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 vendor/symfony/form/Symfony/Component/Form/Tests/Guess/GuessTest.php (limited to 'vendor/symfony/form/Symfony/Component/Form/Tests/Guess') diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Guess/GuessTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Guess/GuessTest.php new file mode 100644 index 00000000..235eb6ed --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Guess/GuessTest.php @@ -0,0 +1,36 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Guess; + +use Symfony\Component\Form\Guess\Guess; + +class TestGuess extends Guess {} + +class GuessTest extends \PHPUnit_Framework_TestCase +{ + public function testGetBestGuessReturnsGuessWithHighestConfidence() + { + $guess1 = new TestGuess(Guess::MEDIUM_CONFIDENCE); + $guess2 = new TestGuess(Guess::LOW_CONFIDENCE); + $guess3 = new TestGuess(Guess::HIGH_CONFIDENCE); + + $this->assertSame($guess3, Guess::getBestGuess(array($guess1, $guess2, $guess3))); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testGuessExpectsValidConfidence() + { + new TestGuess(5); + } +} -- cgit v1.2.3