Skip to content

Commit

Permalink
Ignore unannounced exceptions; declare return type
Browse files Browse the repository at this point in the history
  • Loading branch information
uuf6429 committed Jul 10, 2023
1 parent 5ba4cd2 commit 71e5006
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions tests/Form/GeneralTest.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
<?php

/**
* @noinspection PhpDocMissingThrowsInspection
* @noinspection PhpUnhandledExceptionInspection
*/

namespace Behat\Mink\Tests\Driver\Form;

use Behat\Mink\Exception\DriverException;
use Behat\Mink\Exception\ElementNotFoundException;
use Behat\Mink\Tests\Driver\TestCase;
use Generator;

final class GeneralTest extends TestCase
{
// test multiple submit buttons
public function testIssue212()
public function testIssue212(): void
{
$session = $this->getSession();

Expand All @@ -20,7 +24,7 @@ public function testIssue212()
$this->assertEquals('poney', $field->getValue());
}

public function testBasicForm()
public function testBasicForm(): void
{
$this->getSession()->visit($this->pathTo('/basic_form.html'));

Expand Down Expand Up @@ -60,7 +64,7 @@ public function testBasicForm()
/**
* @dataProvider formSubmitWaysDataProvider
*/
public function testFormSubmitWays(string $submitVia)
public function testFormSubmitWays(string $submitVia): void
{
$session = $this->getSession();
$session->visit($this->pathTo('/basic_form.html'));
Expand All @@ -79,17 +83,17 @@ public function testFormSubmitWays(string $submitVia)
}
}

public static function formSubmitWaysDataProvider()
public static function formSubmitWaysDataProvider(): array
{
return array(
array('Save'),
array('input-type-image'),
array('button-without-type'),
array('button-type-submit'),
);
return [
['Save'],
['input-type-image'],
['button-without-type'],
['button-type-submit'],
];
}

public function testFormSubmit()
public function testFormSubmit(): void
{
$session = $this->getSession();
$session->visit($this->pathTo('/basic_form.html'));
Expand All @@ -104,7 +108,7 @@ public function testFormSubmit()
}
}

public function testFormSubmitWithoutButton()
public function testFormSubmitWithoutButton(): void
{
$session = $this->getSession();
$session->visit($this->pathTo('/form_without_button.html'));
Expand All @@ -119,7 +123,7 @@ public function testFormSubmitWithoutButton()
}
}

public function testBasicGetForm()
public function testBasicGetForm(): void
{
$this->getSession()->visit($this->pathTo('/basic_get_form.php'));
$webAssert = $this->getAssertSession();
Expand All @@ -135,7 +139,7 @@ public function testBasicGetForm()
$this->assertEquals('some#query', $div->getText());
}

public function testAdvancedForm()
public function testAdvancedForm(): void
{
$this->getSession()->visit($this->pathTo('/advanced_form.html'));
$page = $this->getSession()->getPage();
Expand Down Expand Up @@ -224,7 +228,7 @@ public function testAdvancedForm()
}
}

public function testQuoteInValue()
public function testQuoteInValue(): void
{
$this->getSession()->visit($this->pathTo('/advanced_form.html'));

Expand Down Expand Up @@ -264,7 +268,7 @@ public function testQuoteInValue()
}
}

public function testMultiInput()
public function testMultiInput(): void
{
$this->getSession()->visit($this->pathTo('/multi_input_form.html'));
$page = $this->getSession()->getPage();
Expand Down Expand Up @@ -309,7 +313,7 @@ public function testMultiInput()
$this->assertStringContainsString($out, $page->getContent());
}

public function testAdvancedFormSecondSubmit()
public function testAdvancedFormSecondSubmit(): void
{
$this->getSession()->visit($this->pathTo('/advanced_form.html'));
$page = $this->getSession()->getPage();
Expand All @@ -331,7 +335,7 @@ public function testAdvancedFormSecondSubmit()
}
}

public function testSubmitEmptyTextarea()
public function testSubmitEmptyTextarea(): void
{
$this->getSession()->visit($this->pathTo('/empty_textarea.html'));
$page = $this->getSession()->getPage();
Expand All @@ -353,9 +357,7 @@ public function testSubmitEmptyTextarea()

/**
* @dataProvider provideInvalidValues
*
* @param mixed $value
* @throws ElementNotFoundException
*/
public function testSetInvalidValueInField(string $field, $value): void
{
Expand Down

0 comments on commit 71e5006

Please sign in to comment.