Permalink
Browse files

Merge branch 'Acl' of github.com:eddiejaoude/Zend-Framework--Doctrine…

…-ORM--PHPUnit--Ant--Jenkins-CI--TDD- into Acl
  • Loading branch information...
2 parents 61b6b5c + 27aabeb commit 7834bee32f1ab92f285464e9083ec8c3de97fc80 koenHuybrechts committed Jun 20, 2011
Showing with 118 additions and 5 deletions.
  1. +118 −5 application/modules/auth/tests/config/authTest.php
View
123 application/modules/auth/tests/config/authTest.php
@@ -1,7 +1,120 @@
<?php
-
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
+/**
+ * Application Config Dev Mode Test
+ *
+ * @author Koen Huybrechts
+ * @package Application
+ *
*/
-?>
+class AuthTest extends BaseTestCase
+{
+ /**
+ * Config object
+ *
+ * @author Koen Huybrechts
+ * @param object $config
+ *
+ */
+ protected $config;
+
+ /**
+ * Initialisation of config object
+ *
+ * @author Koen Huybrechts
+ * @param null
+ * @return null
+ *
+ */
+ public function setup() {
+ parent::setUp();
+ $this->config = new Zend_Config_Ini(APPLICATION_PATH . '/modules/auth/configs/auth.ini', 'production');
+ }
+
+ /**
+ * Test object creation
+ *
+ * @author Koen Huybrechts
+ * @param null
+ * @return null
+ *
+ */
+ public function testObjectInstance() {
+ $this->assertEquals(true, is_object($this->config));
+ }
+
+ /**
+ * Test password hash is set
+ *
+ * @author Koen Huybrechts
+ * @param null
+ * @return null
+ *
+ */
+ public function testPasswordHashIsSet() {
+ $this->assertTrue(isset($this->config->hash));
+ }
+
+ /**
+ * Test password hash value
+ *
+ * @author Koen Huybrechts
+ * @param null
+ * @return null
+ *
+ */
+ public function testPasswordHashValue() {
+ $this->assertTrue(ctype_alnum($this->config->hash));
+ }
+
+ /**
+ * Test password length isset
+ *
+ * @author Koen Huybrechts
+ * @param null
+ * @return null
+ *
+ */
+ public function testPasswordLengthIsSet() {
+ $this->assertTrue(isset($this->config->password->length));
+ }
+
+ /**
+ * Test password length value integer
+ *
+ * @author Koen Huybrechts
+ * @param null
+ * @return null
+ *
+ */
+ public function testPasswordLengthValueInteger() {
+ $this->assertTrue((int) $this->config->password->length == $this->config->password->length && (int)$this->config->password->length > 0);
+ }
+
+ /**
+ * Test password length value is positive
+ *
+ * @author Koen Huybrechts
+ * @param null
+ * @return null
+ *
+ */
+ public function testPasswordLengthValuePositive() {
+ $this->assertTrue((int)$this->config->password->length > 0);
+ }
+
+ /**
+ * Finaliase (post-tests)
+ *
+ * Deletes class variable $this->consignment
+ *
+ * @author Eddie Jaoude
+ * @param null
+ * @return null
+ *
+ */
+ public function tearDown() {
+ parent::tearDown();
+ unset($this->config);
+ }
+
+}

0 comments on commit 7834bee

Please sign in to comment.