public function upgrade() { $previousVersion = $this->config->getAppValue($this->appName, 'installed_version'); if (version_compare($previousVersion, '7', '<')) { $this->itemService->generateSearchIndices(); } }
public function testNoUpgrade() { $this->config->expects($this->once())->method('getAppValue')->with($this->equalTo('news'), $this->equalTo('installed_version'))->will($this->returnValue('7.0.0')); $this->service->expects($this->never())->method('generateSearchIndices'); $this->upgrade->upgrade(); }