File tree Expand file tree Collapse file tree 3 files changed +105
-7
lines changed
src/Symfony/Cmf/Component/Testing Expand file tree Collapse file tree 3 files changed +105
-7
lines changed Original file line number Diff line number Diff line change 15
15
'de ' => array ('en ' , 'fr ' ),
16
16
'fr ' => array ('en ' , 'de ' ),
17
17
),
18
+ 'mappings ' => array (
19
+ 'test_default ' => array (
20
+ 'type ' => 'annotation ' ,
21
+ 'prefix ' => 'Symfony\Cmf\Component\Testing\Document ' ,
22
+ 'dir ' => CMF_TEST_ROOT_DIR .'/src/Symfony/Cmf/Component/Testing/Document ' ,
23
+ 'is_bundle ' => false ,
24
+ ),
25
+ ),
18
26
),
19
27
);
20
28
24
32
$ phpcrOdmDocPrefix = sprintf ('%s\Tests\Functional\App\Document ' , $ bundleFQN );
25
33
26
34
if (file_exists ($ phpcrOdmDocDir )) {
27
- $ config ['odm ' ]['mappings ' ] = array (
28
- 'test ' => array (
29
- 'type ' => 'annotation ' ,
30
- 'prefix ' => $ phpcrOdmDocPrefix ,
31
- 'dir ' => $ phpcrOdmDocDir ,
32
- 'is_bundle ' => false ,
33
- ),
35
+
36
+ $ config ['odm ' ]['mappings ' ]['test_additional ' ] = array (
37
+ 'type ' => 'annotation ' ,
38
+ 'prefix ' => $ phpcrOdmDocPrefix ,
39
+ 'dir ' => $ phpcrOdmDocDir ,
40
+ 'is_bundle ' => false ,
34
41
);
35
42
}
36
43
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Symfony \Cmf \Component \Testing \Document ;
4
+
5
+ use Doctrine \ODM \PHPCR \Mapping \Annotations as PHPCRODM ;
6
+
7
+ /**
8
+ * Test content document
9
+ *
10
+ * Very simple, referenceable document.
11
+ *
12
+ * @PHPCRODM\Document(referenceable=true)
13
+ */
14
+ class Content
15
+ {
16
+ /**
17
+ * @PHPCRODM\Id(strategy="parent")
18
+ */
19
+ protected $ id ;
20
+
21
+ /**
22
+ * @PHPCRODM\ParentDocument
23
+ */
24
+ protected $ parent ;
25
+
26
+ /**
27
+ * @PHPCRODM\NodeName
28
+ */
29
+ protected $ name ;
30
+
31
+ /**
32
+ * @PHPCRODM\String
33
+ */
34
+ protected $ title ;
35
+
36
+ public function setId ($ id )
37
+ {
38
+ $ this ->id = $ id ;
39
+ }
40
+
41
+ public function getId ()
42
+ {
43
+ return $ this ->id ;
44
+ }
45
+
46
+ public function setParent ($ parent )
47
+ {
48
+ $ this ->parent = $ parent ;
49
+ }
50
+
51
+ public function getParent ()
52
+ {
53
+ return $ this ->parent ;
54
+ }
55
+
56
+ public function setName ($ name )
57
+ {
58
+ $ this ->name = $ name ;
59
+ }
60
+
61
+ public function getName ()
62
+ {
63
+ return $ this ->name ;
64
+ }
65
+
66
+ public function getTitle ()
67
+ {
68
+ return $ this ->title ;
69
+ }
70
+
71
+ public function setTitle ($ title )
72
+ {
73
+ $ this ->title = $ title ;
74
+ }
75
+ }
76
+
Original file line number Diff line number Diff line change @@ -75,4 +75,19 @@ public function loadFixtureClass($loader, $className)
75
75
}
76
76
}
77
77
}
78
+
79
+ public function createTestNode ()
80
+ {
81
+ $ session = $ this ->container ->get ('doctrine_phpcr.session ' );
82
+
83
+ if ($ session ->nodeExists ('/test ' )) {
84
+ $ session ->getNode ('/test ' )->remove ();
85
+ }
86
+
87
+ if (! $ session ->nodeExists ('/test ' )) {
88
+ $ session ->getRootNode ()->addNode ('test ' , 'nt:unstructured ' );
89
+ }
90
+
91
+ $ session ->save ();
92
+ }
78
93
}
You can’t perform that action at this time.
0 commit comments