File: Php81Test.php

package info (click to toggle)
php-symfony-polyfill 1.33.0-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 8,520 kB
  • sloc: php: 127,232; makefile: 69
file content (44 lines) | stat: -rw-r--r-- 1,215 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Polyfill\Tests\Php81;

use PHPUnit\Framework\TestCase;

class Php81Test extends TestCase
{
    /**
     * @covers \Symfony\Polyfill\Php81\Php81::array_is_list
     */
    public function testArrayIsList()
    {
        $this->assertTrue(array_is_list([]));
        $this->assertTrue(array_is_list([\NAN, 'foo', 123]));
        $this->assertFalse(array_is_list([1 => 'a', 0 => 'b']));
        $this->assertFalse(array_is_list(['a' => 'b']));
        $this->assertFalse(array_is_list([0 => 'a', 2 => 'b']));
        $this->assertFalse(array_is_list([1 => 'a', 2 => 'b']));

        $x = ['key' => 2, \NAN];
        unset($x['key']);
        $this->assertTrue(array_is_list($x));
    }

    /**
     * @requires extension mysqli
     * @group legacy
     */
    public function testMysqliRefreshReplicaDefined()
    {
        $this->assertTrue(\defined('MYSQLI_REFRESH_REPLICA'));
        $this->assertSame(MYSQLI_REFRESH_SLAVE, MYSQLI_REFRESH_REPLICA);
    }
}