-
-
Notifications
You must be signed in to change notification settings - Fork 99
/
Copy pathPhpArrayTest.php
61 lines (52 loc) · 1.37 KB
/
PhpArrayTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
namespace Doctrine\Tests\ODM\PHPCR\Functional;
use Doctrine\ODM\PHPCR\Id\RepositoryIdInterface;
use Doctrine\ODM\PHPCR\DocumentRepository;
use Doctrine\ODM\PHPCR\Exception\InvalidArgumentException;
use PHPCR\PropertyType;
use PHPCR\Util\UUIDHelper;
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCRODM;
use Doctrine\Tests\Models\CMS\CmsBlock;
/**
* @group functional
*/
class PhpArrayTest extends \Doctrine\Tests\ODM\PHPCR\PHPCRFunctionalTestCase
{
/**
* @var \Doctrine\ODM\PHPCR\DocumentManager
*/
private $dm;
public function setUp()
{
$this->dm = $this->createDocumentManager(array(__DIR__));
$this->node = $this->resetFunctionalNode($this->dm);
}
public function providePersist()
{
return array(
array(
array(
'rows' => 3,
'title' => 'Foobar',
),
)
);
}
/**
* @dataProvider providePersist
*/
public function testPersist($config)
{
$block = new CmsBlock();
$block->id = '/functional/test';
$block->config = $config;
$this->dm->persist($block);
$this->dm->flush();
$this->dm->clear();
$block = $this->dm->find(null, '/functional/test');
$this->assertSame(
$config,
$block->config
);
}
}