schmunk42\giiant\helpers\GiiantFaker::string PHP Method

string() public static method

public static string ( string $methodName = '' ) : mixed
$methodName string model's attribute type trying to match Faker's method name
return mixed
    public static function string($methodName = '')
    {
        $val = self::provider(self::TYPE_STRING, $methodName);
        return $val === null ? self::value(self::TYPE_STRING) : $val;
    }

Usage Example

示例#1
0
 public function testProviderMethodMACAddress()
 {
     $value = GiiantFaker::string('macAddress');
     $this->specify('returned value is MAC address as string', function () use($value) {
         expect('value is not empty', $value)->notEmpty();
         expect('value is string', is_string($value))->true();
         expect('value is valid MAC address', filter_var($value, FILTER_VALIDATE_MAC) !== false)->true();
     });
 }