respect-validation/tests/library/DataProvider/UndefinedProvider.php
Alexandre Gomes Gaigalas ab3732f91f Use SPDX IDs for licensing
SPDX IDs are shorter than licensing notes previously used, and
adhere better to FOSS standards. It is also machine-readable.
2023-02-19 00:19:10 -03:00

49 lines
907 B
PHP

<?php
/*
* Copyright (c) Alexandre Gomes Gaigalas <alganet@gmail.com>
* SPDX-License-Identifier: MIT
*/
declare(strict_types=1);
namespace Respect\Validation\Test\DataProvider;
/**
* Data provider to use when testing against undefined values.
*
* @author Henrique Moody <henriquemoody@gmail.com>
*/
trait UndefinedProvider
{
/**
* Returns values that are considered as "undefined"
*
* @return mixed[][]
*/
public function providerForUndefined(): array
{
return [
[null],
[''],
];
}
/**
* Returns values that are not considered as "undefined"
*
* @return mixed[][]
*/
public function providerForNotUndefined(): array
{
return [
[0],
[0.0],
['0'],
[false],
[true],
[' '],
[[]],
];
}
}