@@ -8,15 +8,6 @@ class FormatterTest extends Orchestra\Testbench\TestCase {
88 public function setUp () {
99 parent ::setUp ();
1010
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');
2011 }
2112 /**
2213 * A basic functional test for JSON to Array conversion
@@ -37,7 +28,6 @@ public function testJsonToArray() {
3728 */
3829 public function testArrayToJson () {
3930 $ data = array ('foo ' =>'bar ' , 'bar ' =>'foo ' );
40-
4131 $ result = Formatter::make ($ data )->to_json ();
4232 $ expected = '{"foo":"bar","bar":"foo"} ' ;
4333 $ this ->assertEquals ($ expected , $ result );
@@ -50,14 +40,11 @@ public function testArrayToJson() {
5040 */
5141 public function testJSONToXMLToArrayToJsonToArray () {
5242 $ data = '{"foo":"bar","bar":"foo"} ' ;
53-
5443 $ result = Formatter::make ($ data , 'json ' )->to_xml ();
5544 $ result = Formatter::make ($ result , 'xml ' )->to_array ();
5645 $ result = Formatter::make ($ result , 'array ' )->to_json ();
5746 $ result = Formatter::make ($ result , 'json ' )->to_array ();
58-
5947 $ expected = array ('foo ' =>'bar ' , 'bar ' =>'foo ' );
60-
6148 $ this ->assertEquals ($ expected , $ result );
6249 }
6350
@@ -67,26 +54,10 @@ public function testJSONToXMLToArrayToJsonToArray() {
6754 * @return void
6855 */
6956 public function testCSVToArray () {
70- $ data = " foo,bar,bing,bam,boom " ;
57+ $ data = ' foo,bar,bing,bam,boom ' ;
7158 $ 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 ' );
7660 $ this ->assertEquals ($ expected , $ result );
7761 }
7862
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- }
9263}
0 commit comments