Skip to content
New issue

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

[PHP 8.1.2, PHPUnit 10.2.5] Make phpunit executable #2193

Open
wants to merge 1 commit into
base: 1.9/develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/agent.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Test_Agent extends TestCase
/**
* need to setup a fake browser environment
*/
protected function setUp()
protected function setUp(): void
{
// make sure we've got the Agent class in a known state
$_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'en-us,en;q=0.8,nl-be;q=0.5,nl;q=0.3';
Expand Down
8 changes: 4 additions & 4 deletions tests/crypt.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@
class Test_Crypt extends TestCase
{
private static $config_backup = array();

private static $clear_text = "This is a string to encrypt";
private static $legacy_encrypted = "LO01JUJcY4z-BiQeWuOMxaEl9JYJjmLeoZCLgXqMVmtZSXpwN0NPSnJIblRmV0VvZHJKZjUycE5NNWRPOU5EdWlxTjR3MnJMMUtJx";

private static $cipherkey = "a8182a9b8f9231bd6eb092be0223f3b50e6bd26ee8d71d6ceccef8e9906cc59a";

public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
// load and store the current crypt config
\Config::load('crypt', true);
static::$config_backup = \Config::get('crypt', array());

// create a predictable one so we can test
\Config::set('crypt.legacy.crypto_key', '9Kgt0c4LIb1g8GIhyAjnEnuU');
\Config::set('crypt.legacy.crypto_iv', 'PuMQGc0vA-ykX_QShEKRg3B4');
Expand All @@ -43,7 +43,7 @@ public static function setUpBeforeClass()
\Crypt::_init();
}

public static function tearDownAfterClass()
public static function tearDownAfterClass(): void
{
\Config::set('crypt', static::$config_backup);
\Crypt::_init();
Expand Down
2 changes: 1 addition & 1 deletion tests/date.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
class Test_Date extends TestCase
{
protected function setUp()
protected function setUp(): void
{
// make sure the locale and language are is set correctly for the tests
setlocale(LC_ALL, 'en_US') === false and setlocale(LC_ALL, 'en_US.UTF8');
Expand Down
4 changes: 2 additions & 2 deletions tests/debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
*/
class Test_Debug extends TestCase
{
public function setUp()
public function setUp(): void
{
// Remember old value, and set to browser mode.
$this->old_is_cli = \Fuel::$is_cli;
\Fuel::$is_cli = false;
}

public function tearDown()
public function tearDown(): void
{
// Restore original value
\Fuel::$is_cli = $this->old_is_cli;
Expand Down
4 changes: 2 additions & 2 deletions tests/fieldset.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
class Test_Fieldset extends TestCase
{
public function setUp()
public function setUp(): void
{
// fake the uri for this request
isset($_SERVER['PATH_INFO']) and $this->pathinfo = $_SERVER['PATH_INFO'];
Expand All @@ -34,7 +34,7 @@ public function setUp()
\Request::active($request);
}

public function tearDown()
public function tearDown(): void
{
// remove the fake uri
if (property_exists($this, 'pathinfo'))
Expand Down
22 changes: 11 additions & 11 deletions tests/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ class Test_Form extends TestCase
{
private static $config_security;

public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
Config::load('security');
static::$config_security = Config::get('security');
}

public static function tearDownAfterClass()
public static function tearDownAfterClass(): void
{
Config::set('security', static::$config_security);
}

protected function setUp()
protected function setUp(): void
{
Config::load('form');
Config::set('form', array(
Expand Down Expand Up @@ -259,15 +259,15 @@ public function test_label_auto_id_true()
{
$config = \Config::get('form.auto_id');
\Config::set('form.auto_id', true);

$form = \Form::forge(__METHOD__);

$label = 'label';
$id = 'id';
$output = $form->label($label, $id);
$expected = '<label for="form_id">label</label>';
$this->assertEquals($expected, $output);

\Config::set('form.auto_id', $config);
}

Expand All @@ -280,15 +280,15 @@ public function test_label_auto_id_false()
{
$config = \Config::get('form.auto_id');
\Config::set('form.auto_id', false);

$form = \Form::forge(__METHOD__);

$label = 'label';
$id = 'id';
$output = $form->label($label, $id);
$expected = '<label for="id">label</label>';
$this->assertEquals($expected, $output);

\Config::set('form.auto_id', $config);
}

Expand All @@ -300,7 +300,7 @@ public function test_label_auto_id_false()
public function test_open()
{
$form = \Form::forge(__METHOD__);

$output = $form->open('uri/to/form');
$expected = '<form action="uri/to/form" accept-charset="utf-8" method="post">';
$this->assertEquals($expected, $output);
Expand All @@ -316,7 +316,7 @@ public function test_open_auto_csrf_token()
\Config::set('security.csrf_auto_token', true);

$form = \Form::forge(__METHOD__);

$output = $form->open('uri/to/form');
$expected = '<form action="uri/to/form" accept-charset="utf-8" method="post">'.PHP_EOL.'<input name="fuel_csrf_token" value="%s" type="hidden" id="form_fuel_csrf_token" />';
$this->assertStringMatchesFormat($expected, $output);
Expand Down
2 changes: 1 addition & 1 deletion tests/format.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
class Test_Format extends TestCase
{
protected function setUp()
protected function setUp(): void
{
Config::load('format', true);
Config::set('format', array(
Expand Down
4 changes: 2 additions & 2 deletions tests/html.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
*/
class Test_Html extends TestCase
{
public function setUp()
public function setUp(): void
{
$this->old_url_suffix = Config::get('url_suffix');
$this->old_index_file = Config::get('index_file');
$this->old_base_url = Config::get('base_url');
}

public function tearDown()
public function tearDown(): void
{
Config::set('url_suffix', $this->old_url_suffix);
Config::set('index_file', $this->old_index_file);
Expand Down
4 changes: 2 additions & 2 deletions tests/pagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ protected function set_request($uri)
$rp->setValue($this->request, $this->request);
}

protected function setUp()
protected function setUp(): void
{
$this->old_base_url = Config::get('base_url');
}

public function tearDown()
public function tearDown(): void
{
// remove the fake uri
if (property_exists($this, 'pathinfo'))
Expand Down
4 changes: 2 additions & 2 deletions tests/uri.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
*/
class Test_Uri extends TestCase
{
public function setUp()
public function setUp(): void
{
$this->old_url_suffix = Config::get('url_suffix');
$this->old_index_file = Config::get('index_file');
$this->old_base_url = Config::get('base_url');
}

public function tearDown()
public function tearDown(): void
{
Config::set('url_suffix', $this->old_url_suffix);
Config::set('index_file', $this->old_index_file);
Expand Down
1 change: 1 addition & 0 deletions tests/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ final public function offsetUnset(/*mixed */$offset)/*: void*/
unset($this->items[$offset]);
}

#[\ReturnTypeWillChange]
public function getIterator()
{
return new \ArrayIterator($this->items);
Expand Down