2016-05-11 01:55:04 +05:30
|
|
|
<?php
|
|
|
|
namespace codeception\common\unit\helpers;
|
|
|
|
|
|
|
|
use common\helpers\StringHelper;
|
|
|
|
|
|
|
|
class StringHelperTest extends \PHPUnit_Framework_TestCase {
|
|
|
|
|
|
|
|
public function testGetEmailMask() {
|
|
|
|
$this->assertEquals('**@ely.by', StringHelper::getEmailMask('e@ely.by'));
|
|
|
|
$this->assertEquals('e**@ely.by', StringHelper::getEmailMask('es@ely.by'));
|
|
|
|
$this->assertEquals('e**i@ely.by', StringHelper::getEmailMask('eri@ely.by'));
|
|
|
|
$this->assertEquals('er**ch@ely.by', StringHelper::getEmailMask('erickskrauch@ely.by'));
|
|
|
|
$this->assertEquals('эр**уч@елу.бел', StringHelper::getEmailMask('эрикскрауч@елу.бел'));
|
|
|
|
}
|
|
|
|
|
2016-08-04 03:37:21 +05:30
|
|
|
public function testIsUuid() {
|
|
|
|
$this->assertTrue(StringHelper::isUuid('a80b4487-a5c6-45a5-9829-373b4a494135'));
|
|
|
|
$this->assertFalse(StringHelper::isUuid('12345678'));
|
|
|
|
$this->assertFalse(StringHelper::isUuid('12345678-1234-1234-1234-123456789123'));
|
|
|
|
}
|
|
|
|
|
2016-05-11 01:55:04 +05:30
|
|
|
}
|