Skip to content

Commit

Permalink
improve tests before PHP CS Fixer is run
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Dec 17, 2023
1 parent a4ea1f9 commit 8ed4c5e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions tests/Framework/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function test_parse_bytes()

foreach ($data as $value => $expected) {
$result = parse_bytes($value);
$this->assertEquals($expected, $result, "Invalid parse_bytes() result for $value");
$this->{'assertEquals'}($expected, $result, "Invalid parse_bytes() result for $value");
}
}

Expand Down Expand Up @@ -112,7 +112,7 @@ function test_get_offset_sec()
'1h' => 1 * 60 * 60,
'1d' => 1 * 60 * 60 * 24,
'1w' => 1 * 60 * 60 * 24 * 7,
'1y' => (int) '1y',
'1y' => 1,
'100' => 100,
];

Expand Down
12 changes: 6 additions & 6 deletions tests/Framework/Browser.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function useragents()
return [
'WIN: Mozilla Firefox ' => [
'useragent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1',
'version' => '1.8',
'version' => 1.8,
'isWin' => true,
'isLinux' => false,
'isMac' => false,
Expand All @@ -75,7 +75,7 @@ function useragents()

'LINUX: Bon Echo ' => [
'useragent' => 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.1) Gecko/20070222 BonEcho/2.0.0.1',
'version' => '1.8',
'version' => 1.8,
'isWin' => false,
'isLinux' => true,
'isMac' => false,
Expand All @@ -90,7 +90,7 @@ function useragents()

'Chrome Mac' => [
'useragent' => 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.461.0 Safari/534.3',
'version' => '6',
'version' => 6.0,
'isWin' => false,
'isLinux' => false,
'isMac' => true,
Expand All @@ -105,7 +105,7 @@ function useragents()

'IE 11' => [
'useragent' => 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; .NET4.0E; .NET4.0C; rv:11.0) like Gecko',
'version' => '11.0',
'version' => 11.0,
'isWin' => true,
'isLinux' => false,
'isMac' => false,
Expand All @@ -120,7 +120,7 @@ function useragents()

'Opera 15' => [
'useragent' => 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.29 Safari/537.36 OPR/15.0.1147.24',
'version' => '15.0',
'version' => 15.0,
'isWin' => true,
'isLinux' => false,
'isMac' => false,
Expand All @@ -135,7 +135,7 @@ function useragents()

'Edge 14' => [
'useragent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14931',
'version' => '14.14931',
'version' => 14.14931,
'isWin' => true,
'isLinux' => false,
'isMac' => false,
Expand Down
10 changes: 5 additions & 5 deletions tests/Framework/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ function test_list_emails_and_identities()

$this->assertCount(3, $idents);
$this->assertSame('add@ident.com', $idents[0]['email']);
$this->assertEquals(1, $idents[0]['standard']);
$this->{'assertEquals'}(1, $idents[0]['standard']);
$this->assertSame('test@example.com', $idents[1]['email']);
$this->assertEquals(0, $idents[1]['standard']);
$this->{'assertEquals'}(0, $idents[1]['standard']);
$this->assertSame('test@example.org', $idents[2]['email']);
$this->assertEquals(0, $idents[2]['standard']);
$this->{'assertEquals'}(0, $idents[2]['standard']);

$ident = $user->delete_identity($default);

Expand All @@ -154,7 +154,7 @@ function test_failed_login()

$user = new rcube_user(1);

$this->assertEquals(1, $user->data['failed_login_counter']);
$this->{'assertEquals'}(1, $user->data['failed_login_counter']);

$this->assertFalse($user->is_locked());
}
Expand Down Expand Up @@ -190,7 +190,7 @@ function test_create()

$this->assertCount(1, $idents);
$this->assertSame('new@example.com', $idents[0]['email']);
$this->assertEquals(1, $idents[0]['standard']);
$this->{'assertEquals'}(1, $idents[0]['standard']);
}

/**
Expand Down

0 comments on commit 8ed4c5e

Please sign in to comment.