From dfd0080c2c346558e82827adfb019e1b96e3b3a5 Mon Sep 17 00:00:00 2001 From: Alan Garcia Date: Thu, 27 Mar 2014 09:03:22 +0000 Subject: [PATCH] Debut de test unit pour 1580 --- .gitattributes | 1 + phpunit/tests/_datasets/domaines.yml | 11 +++++++++++ phpunit/tests/_datasets/membres.yml | 5 +++-- phpunit/tests/bureau/class/m_mailTest.php | 17 ++++++++++++----- 4 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 phpunit/tests/_datasets/domaines.yml diff --git a/.gitattributes b/.gitattributes index 24120ce7..0f418af0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -605,6 +605,7 @@ nightlybuild/READMEFIRST -text nightlybuild/build.sh -text nightlybuild/mchroot.sh -text nightlybuild/nightly.key -text +phpunit/tests/_datasets/domaines.yml -text po/alternc-admintools.pot -text po/fr/LC_MESSAGES/.svnignore -text po/fr/LC_MESSAGES/alternc-admintools.po -text diff --git a/phpunit/tests/_datasets/domaines.yml b/phpunit/tests/_datasets/domaines.yml new file mode 100644 index 00000000..a3f60c96 --- /dev/null +++ b/phpunit/tests/_datasets/domaines.yml @@ -0,0 +1,11 @@ +domaines: + - + id : 1 + compte : 2001 + domaine : example.tld + gesdns : 1 + gesmx : 1 + noerase : 0 + dns_action : OK + dns_result : 0 + zonettl : 86400 diff --git a/phpunit/tests/_datasets/membres.yml b/phpunit/tests/_datasets/membres.yml index 78186af3..07c70f6c 100644 --- a/phpunit/tests/_datasets/membres.yml +++ b/phpunit/tests/_datasets/membres.yml @@ -1,6 +1,6 @@ membres: - - uid : 0 + uid : 2000 login : admin pass : admin enabled : 1 @@ -11,6 +11,7 @@ membres: lastfail : 0 lastip : 127.0.0.1 - + uid : 2001 login : phpunit pass : phpunit enabled : 1 @@ -19,4 +20,4 @@ membres: show_help : 1 lastlogin : 2014-01-01 00:00:00 lastfail : 0 - lastip : 127.0.0.1 \ No newline at end of file + lastip : 127.0.0.1 diff --git a/phpunit/tests/bureau/class/m_mailTest.php b/phpunit/tests/bureau/class/m_mailTest.php index fa684f02..258f177e 100644 --- a/phpunit/tests/bureau/class/m_mailTest.php +++ b/phpunit/tests/bureau/class/m_mailTest.php @@ -2,7 +2,7 @@ /** * Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2014-03-13 at 15:55:58. */ -class m_mailTest extends PHPUnit_Framework_TestCase +class m_mailTest extends AlterncTest { /** * @var m_mail @@ -19,6 +19,15 @@ class m_mailTest extends PHPUnit_Framework_TestCase $this->object = new m_mail; } + /** + * @return PHPUnit_Extensions_Database_DataSet_IDataSet + */ + public function getDataSet() + { + return parent::loadDataSet("domaines.yml"); + } + + /** * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. @@ -310,10 +319,8 @@ class m_mailTest extends PHPUnit_Framework_TestCase */ public function testCreate_alias() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); + // Test #1580 + $this->object-> } /**