protected function setUp() { $this->licenseDao = M::mock(LicenseDao::classname()); $this->agentsDao = M::mock(AgentDao::classname()); $this->itemTreeBounds = M::mock(ItemTreeBounds::classname()); $this->agentLicenseEventProcessor = new AgentLicenseEventProcessor($this->licenseDao, $this->agentsDao); global $container; $this->dbManagerMock = M::mock(DbManager::classname()); $this->dbManagerMock->shouldReceive('prepare'); $this->dbManagerMock->shouldReceive('execute'); $this->dbManagerMock->shouldReceive('fetchArray')->andReturn($this->latestScanners[0], $this->latestScanners[1], false); $this->dbManagerMock->shouldReceive('freeResult'); $container = M::mock('ContainerBuilder'); $container->shouldReceive('get')->withArgs(array('db.manager'))->andReturn($this->dbManagerMock); }
function setUp() { $this->license1 = new License(10, "shortName", "fullName", "licenseFullText", 4, "URL"); $this->licenseDao = M::mock(LicenseDao::classname())->shouldReceive('getLicenseById')->with($this->license1->getId())->andReturn($this->license1)->getMock(); $this->highlight = new HighlightProcessor($this->licenseDao); }