aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DataTransformerChainTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DataTransformerChainTest.php')
-rw-r--r--vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DataTransformerChainTest.php53
1 files changed, 0 insertions, 53 deletions
diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DataTransformerChainTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DataTransformerChainTest.php
deleted file mode 100644
index 2ee2f22d..00000000
--- a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DataTransformerChainTest.php
+++ /dev/null
@@ -1,53 +0,0 @@
1<?php
2
3/*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <fabien@symfony.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12namespace Symfony\Component\Form\Tests\Extension\Core\DataTransformer;
13
14use Symfony\Component\Form\Extension\Core\DataTransformer\DataTransformerChain;
15
16class DataTransformerChainTest extends \PHPUnit_Framework_TestCase
17{
18 public function testTransform()
19 {
20 $transformer1 = $this->getMock('Symfony\Component\Form\DataTransformerInterface');
21 $transformer1->expects($this->once())
22 ->method('transform')
23 ->with($this->identicalTo('foo'))
24 ->will($this->returnValue('bar'));
25 $transformer2 = $this->getMock('Symfony\Component\Form\DataTransformerInterface');
26 $transformer2->expects($this->once())
27 ->method('transform')
28 ->with($this->identicalTo('bar'))
29 ->will($this->returnValue('baz'));
30
31 $chain = new DataTransformerChain(array($transformer1, $transformer2));
32
33 $this->assertEquals('baz', $chain->transform('foo'));
34 }
35
36 public function testReverseTransform()
37 {
38 $transformer2 = $this->getMock('Symfony\Component\Form\DataTransformerInterface');
39 $transformer2->expects($this->once())
40 ->method('reverseTransform')
41 ->with($this->identicalTo('foo'))
42 ->will($this->returnValue('bar'));
43 $transformer1 = $this->getMock('Symfony\Component\Form\DataTransformerInterface');
44 $transformer1->expects($this->once())
45 ->method('reverseTransform')
46 ->with($this->identicalTo('bar'))
47 ->will($this->returnValue('baz'));
48
49 $chain = new DataTransformerChain(array($transformer1, $transformer2));
50
51 $this->assertEquals('baz', $chain->reverseTransform('foo'));
52 }
53}