Skip to content

Commit

Permalink
Test for the blackList() method #14801
Browse files Browse the repository at this point in the history
  • Loading branch information
Flush authored and niden committed Feb 4, 2020
1 parent 75da90e commit b8cd99e
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions tests/unit/Helper/Arr/BlackListCest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php

/**
* This file is part of the Phalcon Framework.
*
* (c) Phalcon Team <[email protected]>
*
* For the full copyright and license information, please view the LICENSE.txt
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Phalcon\Test\Unit\Helper\Arr;

use Phalcon\Helper\Arr;
use stdClass;
use UnitTester;

class BlackListCest
{
/**
* Unit Tests Phalcon\Helper\Arr :: blackList()
*
* @author Phalcon Team <[email protected]>
* @since 2020-02-01
*/
public function helperArrBlackList(UnitTester $I)
{
$I->wantToTest('Helper\Arr - blackList()');

$value = [
'value-1',
'key-2' => 'value-2',
'key-3' => 'value-3',
9 => 'value-4',
12 => 'value-5',
' key-6 ' => 'value-6',
99 => 'value-7',
'key-8' => 'value-8',
];

$blackList = [
99, 48, 31, 9, 'key-45', null, -228, new stdClass(), [], 3.501, false, 'key-2', 'key-3'
];

$expected = [
'value-1',



12 => 'value-5',
' key-6 ' => 'value-6',

'key-8' => 'value-8',
];

$actual = Arr::blackList($value, $blackList);

$I->assertSame($expected, $actual);
}
}

0 comments on commit b8cd99e

Please sign in to comment.