Propaganistas\LaravelPhone\Tests\PhoneValidatorTest::testValidatePhoneWithCustomCountryField PHP Method

testValidatePhoneWithCustomCountryField() public method

    public function testValidatePhoneWithCustomCountryField()
    {
        // Validator with correct country field supplied, correct type.
        $this->assertTrue($this->performValidation(['field' => '0499123456', 'rule' => 'mobile,country_code', 'country_code' => 'BE']));
        // Validator with correct country field supplied, wrong type.
        $this->assertFalse($this->performValidation(['field' => '016123456', 'rule' => 'mobile,country_code', 'country_code' => 'BE']));
        // Validator with wrong country field supplied, correct type.
        $this->assertFalse($this->performValidation(['field' => '0499123456', 'rule' => 'mobile,country_code', 'country_code' => 'NL']));
        // Validator with wrong country field supplied, wrong type.
        $this->assertFalse($this->performValidation(['field' => '016123456', 'rule' => 'mobile,country_code', 'country_code' => 'NL']));
    }