@@ -8,15 +8,6 @@ class FormatterTest extends Orchestra\Testbench\TestCase {
8
8
public function setUp () {
9
9
parent ::setUp ();
10
10
11
- //$app = m::mock('AppMock');
12
- //$app->shouldReceive('instance')->once()->andReturn($app);
13
-
14
- //Illuminate\Support\Facades\Facade::setFacadeApplication($app);
15
- //Illuminate\Support\Facades\Config::swap($config = m::mock('ConfigMock'));
16
- //Illuminate\Support\Facades\Lang::swap($lang = m::mock('ConfigLang'));
17
-
18
- //$config->shouldReceive('get')->once()->with('logviewer::log_dirs')->andReturn(array('app' => 'app/storage/logs'));
19
- //$this->logviewer = new Logviewer('app', 'cgi-fcgi', '2013-06-01');
20
11
}
21
12
/**
22
13
* A basic functional test for JSON to Array conversion
@@ -37,7 +28,6 @@ public function testJsonToArray() {
37
28
*/
38
29
public function testArrayToJson () {
39
30
$ data = array ('foo ' =>'bar ' , 'bar ' =>'foo ' );
40
-
41
31
$ result = Formatter::make ($ data )->to_json ();
42
32
$ expected = '{"foo":"bar","bar":"foo"} ' ;
43
33
$ this ->assertEquals ($ expected , $ result );
@@ -50,14 +40,11 @@ public function testArrayToJson() {
50
40
*/
51
41
public function testJSONToXMLToArrayToJsonToArray () {
52
42
$ data = '{"foo":"bar","bar":"foo"} ' ;
53
-
54
43
$ result = Formatter::make ($ data , 'json ' )->to_xml ();
55
44
$ result = Formatter::make ($ result , 'xml ' )->to_array ();
56
45
$ result = Formatter::make ($ result , 'array ' )->to_json ();
57
46
$ result = Formatter::make ($ result , 'json ' )->to_array ();
58
-
59
47
$ expected = array ('foo ' =>'bar ' , 'bar ' =>'foo ' );
60
-
61
48
$ this ->assertEquals ($ expected , $ result );
62
49
}
63
50
@@ -67,26 +54,10 @@ public function testJSONToXMLToArrayToJsonToArray() {
67
54
* @return void
68
55
*/
69
56
public function testCSVToArray () {
70
- $ data = " foo,bar,bing,bam,boom " ;
57
+ $ data = ' foo,bar,bing,bam,boom ' ;
71
58
$ result = Formatter::make ($ data , 'csv ' )->to_array ();
72
- $ expected = array ('foo ' =>'bar ' , 'bar ' =>'foo ' );
73
- var_dump ($ result );
74
- var_dump ($ expected );
75
- die ('dead ' );
59
+ $ expected = array ('foo ' ,'bar ' ,'bing ' ,'bam ' ,'boom ' );
76
60
$ this ->assertEquals ($ expected , $ result );
77
61
}
78
62
79
- /**
80
- * A basic functional test for CSV data to array
81
- *
82
- * @return void
83
- */
84
- public function testArrayToCSV () {
85
- $ expected = array ('foo ' =>'bar ' , 'bar ' =>'foo ' );
86
- $ result = Formatter::make ($ data , 'array ' )->to_csv ();
87
- var_dump ($ result );
88
-
89
- $ expected = "foo,bar,bing,bam,boom " ;
90
- $ this ->assertEquals ($ expected , $ result );
91
- }
92
63
}
0 commit comments