public function testIncorrect() { $dom = SimpleHtmlDom::fromUrl(__DIR__ . '/incorrect.html'); $a = new LuckyNumberParser(); $result = $a->getLuckyNumber($dom); $this->assertEquals(null, $result); $this->assertGreaterThan(0, count($a->getErrors())); }
public function run() { Database::init(Config::getInstance()->getDatabaseConfig()); $url = self::URL; $dom = SimpleHtmlDom::fromUrl($url); if ($dom === false) { echo "cannot get {$url}\n"; return; } $this->updateLuckyNumbers($dom); $this->updateReplacements($dom); echo "done\n"; }