ShippingRates/tests/ValidatorTest.php

27 lines
593 B
PHP
Raw Normal View History

2014-12-08 21:59:31 +03:00
<?php
namespace pdt256\Shipping;
2019-12-12 12:20:22 +05:30
use PHPUnit\Framework\TestCase;
use stdClass;
2019-12-12 12:20:22 +05:30
class ValidatorTest extends TestCase
2014-12-08 21:59:31 +03:00
{
/**
* @expectedException \LogicException
*/
public function testNull()
{
Validator::checkIfNull(null, 'null');
}
public function testNotNull()
{
Validator::checkIfNull('XXX', 'notNullValue');
Validator::checkIfNull([], 'notNullValue');
Validator::checkIfNull(new stdClass(), 'notNullValue');
2014-12-08 22:55:53 -08:00
Validator::checkIfNull(function () {
2014-12-08 21:59:31 +03:00
}, 'notNullValue');
$this->assertTrue(true);
2014-12-08 21:59:31 +03:00
}
}