These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Doctrine\Tests\ODM\CouchDB\Types; |
||
4 | |||
5 | use Doctrine\ODM\CouchDB\Types\Type; |
||
6 | |||
7 | class MixedTypeTest extends \Doctrine\Tests\ODM\CouchDB\CouchDBFunctionalTestCase |
||
8 | { |
||
9 | private $type; |
||
10 | |||
11 | public function setUp() |
||
12 | { |
||
13 | $this->type = Type::getType('mixed'); |
||
14 | } |
||
15 | |||
16 | public function testRegisteredInstance() |
||
17 | { |
||
18 | $this->assertInstanceOf('Doctrine\ODM\CouchDB\Types\MixedType', $this->type); |
||
19 | } |
||
20 | |||
21 | static public function dataConvertRoundtrip() |
||
0 ignored issues
–
show
Coding Style
introduced
by
![]() |
|||
22 | { |
||
23 | return array( |
||
24 | array('string', 'string'), |
||
25 | array(1234, 1234), |
||
26 | array(1.345, 1.345), |
||
27 | array(null, null), |
||
28 | array(true, true), |
||
29 | array(false, false), |
||
30 | array(array('foo'), array('foo')), |
||
31 | ); |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * @dataProvider dataConvertRoundtrip |
||
36 | * @param string $expected |
||
37 | * @param string $value |
||
38 | */ |
||
39 | public function testConvertRoundtrip($expected, $value) |
||
40 | { |
||
41 | $this->assertEquals($expected, $this->type->convertToCouchDBValue($this->type->convertToPHPValue($value))); |
||
42 | } |
||
43 | } |