Skip to content

Commit

Permalink
Updating the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanedev-maroc committed Feb 11, 2018
1 parent fe3e412 commit 903b060
Show file tree
Hide file tree
Showing 10 changed files with 147 additions and 141 deletions.
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ checks:
tools:
external_code_coverage:
timeout: 600
runs: 2
runs: 3
php_code_sniffer:
enabled: true
config:
Expand Down
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,16 @@ sudo: false
php:
- 7.0
- 7.1
- 7.2
- nightly

matrix:
allow_failures:
- php: nightly

env:
- TESTBENCH_VERSION=3.5.*

before_script:
- travis_retry composer self-update
- travis_retry composer require --prefer-source --no-interaction --dev "orchestra/testbench:${TESTBENCH_VERSION}"
- travis_retry composer install --prefer-source --no-interaction

script:
- composer validate
Expand Down
4 changes: 2 additions & 2 deletions tests/Laravel/FacadeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ class FacadeTest extends LaravelTestCase
/** @test */
public function it_can_render_script_tag()
{
$this->assertEquals(
static::assertEquals(
$this->getScriptTag(),
NoCaptcha::script()
);

// Echo out only once
$this->assertEmpty(NoCaptcha::script()->toHtml());
static::assertEmpty(NoCaptcha::script()->toHtml());
}

/* -----------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion tests/Laravel/FormMacroTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function it_can_render_captcha_with_laravel_html_package()
$this->app->singleton('form', FormBuilder::class); // This is for BC

foreach ([FormBuilder::class, 'form'] as $alias) {
$this->assertEquals(
static::assertEquals(
'<div class="g-recaptcha" data-sitekey="no-captcha-sitekey" id="captcha" name="captcha"></div>',
$this->app[$alias]->captcha('captcha')
);
Expand Down
12 changes: 6 additions & 6 deletions tests/Laravel/ValidatorRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public function it_can_passes_captcha_rule()
NoCaptcha::CAPTCHA_NAME => ['required', new CaptchaRule],
]);

$this->assertTrue($validator->passes());
$this->assertFalse($validator->fails());
static::assertTrue($validator->passes());
static::assertFalse($validator->fails());
}

/** @test */
Expand All @@ -77,13 +77,13 @@ public function it_can_fails_captcha_rule()
NoCaptcha::CAPTCHA_NAME => ['required', new CaptchaRule],
]);

$this->assertFalse($validator->passes());
$this->assertTrue($validator->fails());
static::assertFalse($validator->passes());
static::assertTrue($validator->fails());

$errors = $validator->messages();

$this->assertTrue($errors->has(NoCaptcha::CAPTCHA_NAME));
$this->assertEquals(
static::assertTrue($errors->has(NoCaptcha::CAPTCHA_NAME));
static::assertEquals(
'validation.captcha',
$errors->first(NoCaptcha::CAPTCHA_NAME)
);
Expand Down
4 changes: 2 additions & 2 deletions tests/NoCaptchaServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function it_can_be_instantiated()
];

foreach ($expectations as $expected) {
$this->assertInstanceOf($expected, $this->provider);
static::assertInstanceOf($expected, $this->provider);
}
}

Expand All @@ -64,6 +64,6 @@ public function it_can_provides()
\Arcanedev\NoCaptcha\Contracts\NoCaptcha::class,
];

$this->assertSame($expected, $this->provider->provides());
static::assertSame($expected, $this->provider->provides());
}
}
Loading

0 comments on commit 903b060

Please sign in to comment.