product = new Product('Paye', 'paye@cnam.fr'); } function tearDown() { $this->product = null; } function testGetMail() { $this->assertEqual('paye@cnam.fr', $this->product->getMail()); } function testSetMail() { $newMail = 'paye2@cnam.fr'; $this->product->setMail($newMail); $this->assertEqual($newMail, $this->product->getMail()); } /* function testCheckMailWithValidLength() { $b = $this->product->checkMail(); $this->assertEqual(true, $b, 'Ce mail est correct!'); } function testCheckTooShortMail() { $b = $this->product->checkMail('x@x'); $this->assertEqual(false, $b, 'Ce mail est trop court!'); } function testCheckTooLongMail() { $this->fail('TODO'); } function testCheckMailWithoutArrobas() { $this->fail('TODO'); } function testCheckMailDomain() { $b = $this->product->checkMail('nobody@cnam.fr'); // Adresse du CNAM => $b should be true $this->assertEqual(true, $b); $b = $this->product->checkMail('nobody@x.com'); // Adresse pas dans le domaine .fr => $b should be false $this->assertEqual(false, $b); } function testCheckMailName() { $this->fail('TODO'); } */ } if (!defined('RUNNER')) { define('RUNNER', true); $test = new ProductTest(); $test->run(new HtmlReporter()); } ?>