public function testSyncAction()
 {
     $this->packagesData->expects($this->once())->method('syncPackagesData')->willReturn($this->lastSyncData);
     $jsonModel = $this->controller->syncAction();
     $this->assertInstanceOf('Zend\\View\\Model\\JsonModel', $jsonModel);
     $variables = $jsonModel->getVariables();
     $this->assertArrayHasKey('success', $variables);
     $this->assertTrue($variables['success']);
     $this->assertEquals($this->lastSyncData, $variables['lastSyncData']);
 }
 public function testSyncAction()
 {
     $this->updatePackagesCacheMock->expects($this->once())->method('syncPackagesForUpdate');
     $this->updatePackagesCacheMock->expects($this->once())->method('getPackagesForUpdate')->willReturn($this->lastSyncData);
     $this->setupTimezoneMock();
     $jsonModel = $this->controller->syncAction();
     $this->assertInstanceOf('Zend\\View\\Model\\JsonModel', $jsonModel);
     $variables = $jsonModel->getVariables();
     $this->assertArrayHasKey('success', $variables);
     $this->assertTrue($variables['success']);
     $expectedLastSyncData = array_replace($this->lastSyncData, $this->convertedLastSyncDate);
     $this->assertEquals($expectedLastSyncData, $variables['lastSyncData']);
 }