2014-12-08 21:59:31 +03:00
|
|
|
<?php
|
|
|
|
namespace pdt256\Shipping;
|
|
|
|
|
|
|
|
class ValidatorTest extends \PHPUnit_Framework_TestCase
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @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');
|
|
|
|
}
|
|
|
|
}
|