/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. */ protected function setUp() { $this->initContainer(); $this->cellFactory = new \Nonogram\Cell\Factory(); $this->cellFactory->setContainer($this->container); $this->runRangeFactory = new \Nonogram\Solver\RunRange\RunRangeFactory(); $this->runRangeFactory->setContainer($this->container); }
/** * @param RunRange\RunRange|null $runRangeOverride option to inject a pre-defined state, only useful for unittests */ private function initRunRanges(RunRange $runRangeOverride = null) { if (null !== $runRangeOverride) { $this->runRanges = $runRangeOverride; return; } $this->runRanges = $this->runRangeFactory->getForLabels($this->labels); }