We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello. I have the following test class:
class ValidatorTest extends \Codeception\TestCase\Test { use \Codeception\Specify; /** * @var \mb\tools\url\Validator $instance ; */ public $instance; /** * @var \UnitTester */ protected $tester; /** * @inheritdoc */ protected function _before() { $this->instance = new \mb\tools\url\Validator(); $this->assertInstanceOf('\mb\tools\url\Validator', $this->instance); } /** * @covers \mb\tools\url\Validator::url */ public function testUrl() { $dataDir = \Codeception\Configuration::dataDir(); $urlSamples = include("{$dataDir}/url_samples.php"); var_dump($this->instance->validSchemes); $this->specify('check URLs with invalid scheme if $validSchemes property is set', function ($testData) { $this->instance->validSchemes = ['https', 'ftps']; verify($this->instance->url($testData))->false(); }, ['examples' => $urlSamples['restrictedScheme']]); var_dump($this->instance->validSchemes); die; } }
The results are:
array(2) { [0] => string(4) "http" [1] => string(5) "https" } array(2) { [0] => string(5) "https" [1] => string(4) "ftps" }
Means that $this->instance class attribute has been changed. What am I doing wrong?
$this->instance
For now, I was able to workaround this with help of
$this->beforeSpecify(function() { $this->instance = new \mb\tools\url\Validator(); });
But it doesn't looks like correct solution.
The text was updated successfully, but these errors were encountered:
b26c37f
Fixed in f040e2e
Sorry, something went wrong.
added tester to ignore list. Fix #6
0e3ba34
No branches or pull requests
Hello. I have the following test class:
The results are:
Means that
$this->instance
class attribute has been changed. What am I doing wrong?For now, I was able to workaround this with help of
But it doesn't looks like correct solution.
The text was updated successfully, but these errors were encountered: