2
2
3
3
namespace Symfony \Cmf \Bundle \TreeBrowserBundle \Tests \Functional \PHPCR ;
4
4
5
- use Symfony \Cmf \Bundle \TreeBrowserBundle \Tests \Functional \BaseTestCase ;
5
+
6
+ use Symfony \Cmf \Component \Testing \Functional \BaseTestCase ;
6
7
7
8
/**
8
9
* Functional test for PHPCRBrowser
@@ -19,10 +20,13 @@ public function testGetChildrenListFromRoot()
19
20
$ client = $ this ->createClient ();
20
21
21
22
$ client ->request ('GET ' , '/_cmf_tree/phpcr_tree/children ' );
23
+ $ response = $ client ->getResponse ();
24
+
25
+ $ this ->assertEquals (200 , $ response ->getStatusCode ());
22
26
23
27
$ this ->assertEquals (
24
- $ client -> getResponse ()-> getContent () ,
25
- ' [{"data":"cms","attr":{"id":"\/cms","url_safe_id":"cms","rel":"node"},"state":"closed","children":[{"data":"content","attr":{"id":"\/cms\/content","url_safe_id":"cms\/content","rel":"node"},"state":"closed"}]},{"data":"menus","attr":{"id":"\/menus","url_safe_id":"menus","rel":"node"},"state":"closed","children":[{"data":"test","attr":{"id":"\/menus\/test","url_safe_id":"menus\/test","rel":"node"},"state":null}]}] '
28
+ ' [{"data":"cms","attr":{"id":"\/cms","url_safe_id":"cms","rel":"node"},"state":"closed","children":[{"data":"content","attr":{"id":"\/cms\/content","url_safe_id":"cms\/content","rel":"node"},"state":"closed"}]},{"data":"menus","attr":{"id":"\/menus","url_safe_id":"menus","rel":"node"},"state":"closed","children":[{"data":"test","attr":{"id":"\/menus\/test","url_safe_id":"menus\/test","rel":"node"},"state":null}]}] ' ,
29
+ $ client -> getResponse ()-> getContent ()
26
30
);
27
31
}
28
32
@@ -33,20 +37,19 @@ public function testGetChildrenListFromInnerNode()
33
37
$ client = $ this ->createClient ();
34
38
35
39
$ crawler = $ client ->request ('GET ' , '/_cmf_tree/phpcr_tree/children?root=%2Fcms%2Fcontent ' );
40
+ $ response = $ client ->getResponse ();
41
+
42
+ $ this ->assertEquals (200 , $ response ->getStatusCode ());
36
43
37
44
$ this ->assertEquals (
38
- $ client -> getResponse ()-> getContent () ,
39
- ' [{"data":"static","attr":{"id":"\/cms\/content\/static","url_safe_id":"cms\/content\/static","rel":"node"},"state":"closed","children":[{"data":"test","attr":{"id":"\/cms\/content\/static\/test","url_safe_id":"cms\/content\/static\/test","rel":"node"},"state":null}]}] '
45
+ ' [{"data":"static","attr":{"id":"\/cms\/content\/static","url_safe_id":"cms\/content\/static","rel":"node"},"state":"closed","children":[{"data":"test","attr":{"id":"\/cms\/content\/static\/test","url_safe_id":"cms\/content\/static\/test","rel":"node"},"state":null}]}] ' ,
46
+ $ client -> getResponse ()-> getContent ()
40
47
);
41
48
}
42
49
43
50
protected function loadFixtures ()
44
51
{
45
- self ::$ kernel = self ::createKernel ();
46
- self ::$ kernel ->init ();
47
- self ::$ kernel ->boot ();
48
-
49
- $ session = self ::$ kernel ->getContainer ()->get ('doctrine_phpcr.session ' );
52
+ $ session = $ this ->getContainer ()->get ('doctrine_phpcr.session ' );
50
53
if ($ session ->nodeExists ("/cms " )) {
51
54
$ session ->getNode ("/cms " )->remove ();
52
55
}
@@ -65,4 +68,4 @@ protected function loadFixtures()
65
68
$ session ->save ();
66
69
}
67
70
68
- }
71
+ }
0 commit comments