Browse Source

Merge pull request #3609 from php-engineer/master-docblock

Correct Docblock
Mark Story 11 years ago
parent
commit
3108217d73

+ 1 - 1
lib/Cake/Model/ModelValidator.php

@@ -544,7 +544,7 @@ class ModelValidator implements ArrayAccess, IteratorAggregate, Countable {
  *		));
  * }}}
  *
- * @param string $field The name of the field from which the rule will be removed
+ * @param string $field The name of the field where the rule is to be added
  * @param string|array|CakeValidationSet $name name of the rule to be added or list of rules for the field
  * @param array|CakeValidationRule $rule or list of rules to be added to the field's rule set
  * @return ModelValidator this instance

+ 19 - 0
lib/Cake/Test/Case/Network/Http/HttpSocketTest.php

@@ -1737,6 +1737,25 @@ class HttpSocketTest extends CakeTestCase {
 	}
 
 /**
+ * Test that requests fail when peer verification fails.
+ *
+ * @return void
+ */
+	public function testVerifyPeer() {
+		$this->skipIf(!extension_loaded('openssl'), 'OpenSSL is not enabled cannot test SSL.');
+		$socket = new HttpSocket();
+		try {
+			$socket->get('https://tv.eurosport.com/');
+			$this->markTestSkipped('Found valid certificate, was expecting invalid certificate.');
+		} catch (SocketException $e) {
+			$message = $e->getMessage();
+			$this->skipIf(strpos($message, 'Invalid HTTP') !== false, 'Invalid HTTP Response received, skipping.');
+			$this->assertContains('Peer certificate CN', $message);
+			$this->assertContains('Failed to enable crypto', $message);
+		}
+	}
+
+/**
  * Data provider for status codes.
  *
  * @return array