/** * @covers sBasket::sCountNotes * @depends testsGetNotes */ public function testsCountNotes($input) { list($randomArticleOne, $cookieId) = $input; // Test with no id in cookie $_COOKIE["sUniqueID"] = $cookieId; $this->assertEquals(1, $this->module->sCountNotes()); // Add another article to the basket $randomArticleTwo = $this->db->fetchRow('SELECT detail.articleID, article.name, detail.ordernumber FROM s_articles_details detail INNER JOIN s_articles article ON article.id = detail.articleID WHERE detail.active = 1 AND detail.id <> ? ORDER BY RAND() LIMIT 1', array($randomArticleOne['id'])); $this->assertTrue($this->module->sAddNote($randomArticleTwo['articleID'], $randomArticleTwo['name'], $randomArticleTwo['ordernumber'])); $this->assertEquals(2, $this->module->sCountNotes()); return array(array($randomArticleOne, $randomArticleTwo), $cookieId); }