mscherer 9 years ago
parent
commit
07a579cbd2

+ 1 - 1
.travis.yml

@@ -46,7 +46,7 @@ before_script:
 
 script:
   - sh -c "if [ '$DEFAULT' = '1' ]; then phpunit; fi"
-  - sh -c "if [ '$PHPCS' = '1' ]; then vendor/bin/phpcs -p --extensions=php --standard=vendor/fig-r/psr2r-sniffer/PSR2R/ruleset.xml --ignore=vendor --ignore=docs . ; fi"
+  - sh -c "if [ '$PHPCS' = '1' ]; then vendor/bin/phpcs -p --extensions=php --standard=vendor/fig-r/psr2r-sniffer/PSR2R/ruleset.xml --ignore=vendor --ignore=docs --ignore=test_files . ; fi"
 
   - sh -c "if [ '$CODECOVERAGE' = '1' ]; then phpunit --coverage-clover=clover.xml || true; fi"
   - sh -c "if [ '$CODECOVERAGE' = '1' ]; then wget -O codecov.sh https://codecov.io/bash; fi"

+ 68 - 68
tests/TestCase/Mailer/EmailTest.php

@@ -9,74 +9,6 @@ use Tools\Mailer\Email;
 use Tools\TestSuite\TestCase;
 
 /**
- * Help to test Email
- */
-class TestEmail extends Email {
-
-	/**
-	 * Wrap to protected method
-	 *
-	 * @param array $address
-	 * @return array
-	 */
-	public function formatAddress($address) {
-		return parent::_formatAddress($address);
-	}
-
-	/**
-	 * Wrap to protected method
-	 *
-	 * @param string $text
-	 * @param int $length
-	 * @return array
-	 */
-	public function wrap($text, $length = Email::LINE_LENGTH_MUST) {
-		return parent::_wrap($text, $length);
-	}
-
-	/**
-	 * Get the boundary attribute
-	 *
-	 * @return string
-	 */
-	public function getBoundary() {
-		return $this->_boundary;
-	}
-
-	/**
-	 * Encode to protected method
-	 *
-	 * @param string $text
-	 * @return string
-	 */
-	public function encode($text) {
-		return $this->_encode($text);
-	}
-
-	/**
-	 * Render to protected method
-	 *
-	 * @param string $content
-	 * @return array
-	 */
-	public function render($content) {
-		return $this->_render($content);
-	}
-
-	/**
-	 * TestEmail::getProtected()
-	 *
-	 * @param string $attribute
-	 * @return mixed
-	 */
-	public function getProtected($attribute) {
-		$attribute = '_' . $attribute;
-		return $this->$attribute;
-	}
-
-}
-
-/**
  * EmailTest class
  */
 class EmailTest extends TestCase {
@@ -470,3 +402,71 @@ HTML;
 	}
 
 }
+
+/**
+ * Help to test Email
+ */
+class TestEmail extends Email {
+
+	/**
+	 * Wrap to protected method
+	 *
+	 * @param array $address
+	 * @return array
+	 */
+	public function formatAddress($address) {
+		return parent::_formatAddress($address);
+	}
+
+	/**
+	 * Wrap to protected method
+	 *
+	 * @param string $text
+	 * @param int $length
+	 * @return array
+	 */
+	public function wrap($text, $length = Email::LINE_LENGTH_MUST) {
+		return parent::_wrap($text, $length);
+	}
+
+	/**
+	 * Get the boundary attribute
+	 *
+	 * @return string
+	 */
+	public function getBoundary() {
+		return $this->_boundary;
+	}
+
+	/**
+	 * Encode to protected method
+	 *
+	 * @param string $text
+	 * @return string
+	 */
+	public function encode($text) {
+		return $this->_encode($text);
+	}
+
+	/**
+	 * Render to protected method
+	 *
+	 * @param string $content
+	 * @return array
+	 */
+	public function render($content) {
+		return $this->_render($content);
+	}
+
+	/**
+	 * TestEmail::getProtected()
+	 *
+	 * @param string $attribute
+	 * @return mixed
+	 */
+	public function getProtected($attribute) {
+		$attribute = '_' . $attribute;
+		return $this->$attribute;
+	}
+
+}

+ 5 - 7
tests/TestCase/Model/Entity/EntityTest.php

@@ -4,10 +4,9 @@ namespace Tools\Model\Entity;
 
 use Cake\Core\Configure;
 use Cake\ORM\TableRegistry;
-use Tools\Model\Entity\Entity;
 use Tools\TestSuite\TestCase;
 
-class PasswordableBehaviorTest extends TestCase {
+class EntityTest extends TestCase {
 
 	/**
 	 * @var array
@@ -17,13 +16,11 @@ class PasswordableBehaviorTest extends TestCase {
 	];
 
 	/**
-	 * @var \Tools\Model\Table\Table;
+	 * @var \Tools\Model\Table\Table
 	 */
 	public $Users;
 
 	/**
-	 * SetUp method
-	 *
 	 * @return void
 	 */
 	public function setUp() {
@@ -34,6 +31,9 @@ class PasswordableBehaviorTest extends TestCase {
 		$this->Users = TableRegistry::get('ToolsUsers');
 	}
 
+	/**
+	 * @return void
+	 */
 	public function tearDown() {
 		TableRegistry::clear();
 
@@ -41,8 +41,6 @@ class PasswordableBehaviorTest extends TestCase {
 	}
 
 	/**
-	 * MyModelTest::testEnum()
-	 *
 	 * @return void
 	 */
 	public function testEnum() {

+ 9 - 7
tests/TestCase/View/Helper/ObsfuscateHelperTest.php

@@ -8,26 +8,32 @@ use Tools\View\Helper\ObfuscateHelper;
 
 class ObfuscateHelperTest extends TestCase {
 
+	/**
+	 * @return void
+	 */
 	public function setUp() {
 		parent::setUp();
 
 		$this->Obfuscate = new ObfuscateHelper(new View());
 	}
 
+	/**
+	 * @return void
+	 */
 	public function tearDown() {
 		unset($this->Table);
 
  		parent::tearDown();
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testObject() {
 		$this->assertInstanceOf('Tools\View\Helper\ObfuscateHelper', $this->Obfuscate);
 	}
 
-
 	/**
-	 * ObfuscateHelperTest::testEncodeEmails()
-	 *
 	 * @return void
 	 */
 	public function testEncodeEmail() {
@@ -37,8 +43,6 @@ class ObfuscateHelperTest extends TestCase {
 	}
 
 	/**
-	 * ObfuscateHelperTest::testEncodeEmailUrl()
-	 *
 	 * @return void
 	 */
 	public function testEncodeEmailUrl() {
@@ -48,8 +52,6 @@ class ObfuscateHelperTest extends TestCase {
 	}
 
 	/**
-	 * ObfuscateHelperTest::testEncodeText()
-	 *
 	 * @return void
 	 */
 	public function testEncodeText() {