File tree 4 files changed +27
-0
lines changed
Bundle/WebProfilerBundle/Tests/Command 4 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 16
16
use Symfony \Component \Console \Tester \CommandTester ;
17
17
use Symfony \Component \HttpKernel \Profiler \Profile ;
18
18
19
+ /**
20
+ * @group legacy
21
+ */
19
22
class ExportCommandTest extends \PHPUnit_Framework_TestCase
20
23
{
21
24
/**
Original file line number Diff line number Diff line change 12
12
namespace Symfony \Bundle \WebProfilerBundle \Tests \Command ;
13
13
14
14
use Symfony \Bundle \WebProfilerBundle \Command \ImportCommand ;
15
+ use Symfony \Component \Console \Helper \HelperSet ;
15
16
use Symfony \Component \Console \Tester \CommandTester ;
16
17
use Symfony \Component \HttpKernel \Profiler \Profile ;
17
18
19
+ /**
20
+ * @group legacy
21
+ */
18
22
class ImportCommandTest extends \PHPUnit_Framework_TestCase
19
23
{
20
24
public function testExecute ()
@@ -27,7 +31,14 @@ public function testExecute()
27
31
28
32
$ profiler ->expects ($ this ->once ())->method ('import ' )->will ($ this ->returnValue (new Profile ('TOKEN ' )));
29
33
34
+ $ helperSet = new HelperSet ();
35
+ $ helper = $ this ->getMock ('Symfony\Component\Console\Helper\FormatterHelper ' );
36
+ $ helper ->expects ($ this ->any ())->method ('formatSection ' );
37
+ $ helperSet ->set ($ helper , 'formatter ' );
38
+
30
39
$ command = new ImportCommand ($ profiler );
40
+ $ command ->setHelperSet ($ helperSet );
41
+
31
42
$ commandTester = new CommandTester ($ command );
32
43
$ commandTester ->execute (array ('filename ' => __DIR__ .'/../Fixtures/profile.data ' ));
33
44
$ this ->assertRegExp ('/Profile "TOKEN" has been successfully imported\./ ' , $ commandTester ->getDisplay ());
Original file line number Diff line number Diff line change 1
1
CHANGELOG
2
2
=========
3
3
4
+ 2.8.0
5
+ -----
6
+
7
+ * deprecated ` Profiler::import ` and ` Profiler::export `
8
+
4
9
2.7.0
5
10
-----
6
11
Original file line number Diff line number Diff line change @@ -137,9 +137,13 @@ public function purge()
137
137
* @param Profile $profile A Profile instance
138
138
*
139
139
* @return string The exported data
140
+ *
141
+ * @deprecated since Symfony 2.8, to be removed in 3.0.
140
142
*/
141
143
public function export (Profile $ profile )
142
144
{
145
+ @trigger_error ('The ' .__METHOD__ .' method is deprecated since version 2.8 and will be removed in 3.0. ' , E_USER_DEPRECATED );
146
+
143
147
return base64_encode (serialize ($ profile ));
144
148
}
145
149
@@ -149,9 +153,13 @@ public function export(Profile $profile)
149
153
* @param string $data A data string as exported by the export() method
150
154
*
151
155
* @return Profile A Profile instance
156
+ *
157
+ * @deprecated since Symfony 2.8, to be removed in 3.0.
152
158
*/
153
159
public function import ($ data )
154
160
{
161
+ @trigger_error ('The ' .__METHOD__ .' method is deprecated since version 2.8 and will be removed in 3.0. ' , E_USER_DEPRECATED );
162
+
155
163
$ profile = unserialize (base64_decode ($ data ));
156
164
157
165
if ($ this ->storage ->read ($ profile ->getToken ())) {
You can’t perform that action at this time.
0 commit comments