mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-15 14:20:24 +00:00
Move PHPUnit tests into a tests/phpunit directory.
wp-tests-config.php can/should reside in the root of a develop checkout. `phpunit` should be run from the root. see #25088. git-svn-id: https://develop.svn.wordpress.org/trunk@25165 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @group formatting
|
||||
*/
|
||||
class Tests_Formatting_IsEmail extends WP_UnitTestCase {
|
||||
function test_returns_true_if_given_a_valid_email_address() {
|
||||
$data = array(
|
||||
"bob@example.com",
|
||||
"phil@example.info",
|
||||
"ace@204.32.222.14",
|
||||
"kevin@many.subdomains.make.a.happy.man.edu"
|
||||
);
|
||||
foreach ( $data as $datum ) {
|
||||
$this->assertEquals( $datum, is_email($datum), $datum );
|
||||
}
|
||||
}
|
||||
|
||||
function test_returns_false_if_given_an_invalid_email_address() {
|
||||
$data = array(
|
||||
"khaaaaaaaaaaaaaaan!",
|
||||
'http://bob.example.com/',
|
||||
"sif i'd give u it, spamer!1",
|
||||
"com.exampleNOSPAMbob",
|
||||
"bob@your mom"
|
||||
);
|
||||
foreach ($data as $datum) {
|
||||
$this->assertFalse(is_email($datum), $datum);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user