@@ -111,7 +111,7 @@ |
||
| 111 | 111 | public function setConfig($config) |
| 112 | 112 | { |
| 113 | 113 | $this->config = $config; |
| 114 | - $this->config['cache_dir'] = $this->config['cache_dir'] . '/' . 'BingAdsApiBundle'; //<-- important for the cache clear function |
|
| 114 | + $this->config['cache_dir'] = $this->config['cache_dir'].'/'.'BingAdsApiBundle'; //<-- important for the cache clear function |
|
| 115 | 115 | $this->config['csv']['fixHeader']['removeColumnHeader'] = true; //-- fix till i know how to do this |
| 116 | 116 | } |
| 117 | 117 | |
@@ -87,7 +87,7 @@ |
||
| 87 | 87 | |
| 88 | 88 | for ($i = 0; $i < count($array); ++$i) { |
| 89 | 89 | if ($enclosure) { |
| 90 | - $csvStr .= $enclosure . str_replace($enclosure, $enclosure . $enclosure, $array[$i]) . $enclosure; |
|
| 90 | + $csvStr .= $enclosure.str_replace($enclosure, $enclosure.$enclosure, $array[$i]).$enclosure; |
|
| 91 | 91 | } else { |
| 92 | 92 | $csvStr .= $array[$i]; |
| 93 | 93 | } |
@@ -25,10 +25,10 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | public function testGetFile() |
| 27 | 27 | { |
| 28 | - $nonExistingFile = ASSETS_DIR . 'iDoNotExist.txt'; |
|
| 29 | - $existingFile = ASSETS_DIR . 'report.csv'; |
|
| 28 | + $nonExistingFile = ASSETS_DIR.'iDoNotExist.txt'; |
|
| 29 | + $existingFile = ASSETS_DIR.'report.csv'; |
|
| 30 | 30 | $onlineFile = 'http://google.com/test.txt'; |
| 31 | - $file = ASSETS_DIR . 'example.txt'; |
|
| 31 | + $file = ASSETS_DIR.'example.txt'; |
|
| 32 | 32 | |
| 33 | 33 | $mock = new MockHandler([new Response(200, [])]); |
| 34 | 34 | $handler = HandlerStack::create($mock); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | public function testDownload() |
| 55 | 55 | { |
| 56 | 56 | $url = 'http://example.com'; |
| 57 | - $file = ASSETS_DIR . 'example.txt'; |
|
| 57 | + $file = ASSETS_DIR.'example.txt'; |
|
| 58 | 58 | |
| 59 | 59 | $clientMock = Mockery::mock(Client::class); |
| 60 | 60 | $clientMock |
@@ -82,14 +82,14 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | public function testUnZip() |
| 84 | 84 | { |
| 85 | - $file = ASSETS_DIR . 'test.zip'; |
|
| 85 | + $file = ASSETS_DIR.'test.zip'; |
|
| 86 | 86 | |
| 87 | - $this->fileSystem->copy(ASSETS_DIR . 'report.zip', $file); |
|
| 87 | + $this->fileSystem->copy(ASSETS_DIR.'report.zip', $file); |
|
| 88 | 88 | |
| 89 | 89 | $fileHelper = new File(); |
| 90 | 90 | $files = $fileHelper->unZip($file); |
| 91 | 91 | |
| 92 | - $this->assertEquals($files, [ASSETS_DIR . '0039202.csv']); |
|
| 92 | + $this->assertEquals($files, [ASSETS_DIR.'0039202.csv']); |
|
| 93 | 93 | |
| 94 | 94 | //-- Remove the files created by this test |
| 95 | 95 | foreach ($files as $file) { |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | public function testCorruptUnZip() |
| 104 | 104 | { |
| 105 | - $file = ASSETS_DIR . 'corrupt.zip'; |
|
| 105 | + $file = ASSETS_DIR.'corrupt.zip'; |
|
| 106 | 106 | $fileHelper = new File(); |
| 107 | 107 | $fileHelper->unZip($file, false); |
| 108 | 108 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | $this->getTimeHelperMock() |
| 69 | 69 | ); |
| 70 | 70 | $result = $apiClient->get(['TimePeriod', 'AccountName', 'AdGroupId'], 'GeoLocationPerformanceReport', ReportTimePeriod::LastWeek); |
| 71 | - $this->assertEquals([ASSETS_DIR . 'report.csv'], $result); |
|
| 71 | + $this->assertEquals([ASSETS_DIR.'report.csv'], $result); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | public function testGeoLocationPerformanceReportMoveFile() |
@@ -81,12 +81,12 @@ discard block |
||
| 81 | 81 | $this->getCsvHelperMock(), |
| 82 | 82 | $this->getTimeHelperMock() |
| 83 | 83 | ); |
| 84 | - $result = $apiClient->get(['TimePeriod', 'AccountName', 'AdGroupId'], 'GeoLocationPerformanceReport', ReportTimePeriod::LastWeek, ASSETS_DIR . 'test.csv'); |
|
| 85 | - $this->assertEquals(ASSETS_DIR . 'test.csv', $result); |
|
| 84 | + $result = $apiClient->get(['TimePeriod', 'AccountName', 'AdGroupId'], 'GeoLocationPerformanceReport', ReportTimePeriod::LastWeek, ASSETS_DIR.'test.csv'); |
|
| 85 | + $this->assertEquals(ASSETS_DIR.'test.csv', $result); |
|
| 86 | 86 | |
| 87 | 87 | //--Move File back |
| 88 | 88 | $fileSystem = new Filesystem(); |
| 89 | - $fileSystem->rename(ASSETS_DIR . 'test.csv', ASSETS_DIR . 'report.csv'); |
|
| 89 | + $fileSystem->rename(ASSETS_DIR.'test.csv', ASSETS_DIR.'report.csv'); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | public function testGetRefreshToken() |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | ->once() |
| 225 | 225 | ->shouldReceive('unZip') |
| 226 | 226 | ->with('/tmp/report.zip') |
| 227 | - ->andReturn([ASSETS_DIR . 'report.csv']) |
|
| 227 | + ->andReturn([ASSETS_DIR.'report.csv']) |
|
| 228 | 228 | ->once(); |
| 229 | 229 | |
| 230 | 230 | return $zipHelperMock; |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | */ |
| 236 | 236 | private function getCsvHelperMock() |
| 237 | 237 | { |
| 238 | - $lines = file(ASSETS_DIR . 'report.csv'); |
|
| 238 | + $lines = file(ASSETS_DIR.'report.csv'); |
|
| 239 | 239 | $csvHelperMock = Mockery::mock(Helper\Csv::class); |
| 240 | 240 | $csvHelperMock |
| 241 | 241 | ->shouldReceive('removeHeaders') |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | $configuration = new Configuration(); |
| 22 | 22 | $config = $this->processConfiguration($configuration, $configs); |
| 23 | 23 | |
| 24 | - $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
| 24 | + $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
|
| 25 | 25 | $loader->load('services.yml'); |
| 26 | 26 | |
| 27 | 27 | // Once the services definition are read, get your service and add a method call to setConfig() |