null() public static méthode

Checks NULL assertion.
public static null ( $actual, $description = NULL ) : void
Résultat void
Exemple #1
0
function routeIn(Nette\Application\IRouter $route, $url, $expectedPresenter = NULL, $expectedParams = NULL, $expectedUrl = NULL, $scriptPath = NULL)
{
    $url = new Nette\Http\UrlScript("http://example.com{$url}");
    if ($scriptPath) {
        $url->setScriptPath($scriptPath);
    }
    if ($url->getQueryParameter('presenter') === NULL) {
        $url->setQueryParameter('presenter', 'querypresenter');
    }
    $url->appendQuery(['test' => 'testvalue']);
    $httpRequest = new Nette\Http\Request($url);
    $request = $route->match($httpRequest);
    if ($request) {
        // matched
        $params = $request->getParameters();
        asort($params);
        asort($expectedParams);
        Assert::same($expectedPresenter, $request->getPresenterName());
        Assert::same($expectedParams, $params);
        $result = $route->constructUrl($request, $url);
        Assert::same($expectedUrl, $result);
    } else {
        // not matched
        Assert::null($expectedPresenter);
    }
}
 public function __construct($abc, $xyz, $false, $null)
 {
     \Tester\Assert::same('test', $abc);
     \Tester\Assert::same(159753, $xyz);
     \Tester\Assert::same(FALSE, $false);
     \Tester\Assert::null($null);
 }
Exemple #3
0
 public final function testOnRequestOnResponse()
 {
     $client = $this->createClient();
     $insideRequest = NULL;
     $client->onRequest(function (Request $request) use(&$insideRequest) {
         $insideRequest = $request;
     });
     $insideResponse = NULL;
     $client->onResponse(function (Response $response) use(&$insideResponse) {
         $insideResponse = $response;
     });
     Assert::null($insideRequest);
     Assert::null($insideResponse);
     $client->process(new Request('GET', $this->baseUrl . '/ping'));
     Assert::type('Bitbang\\Http\\Request', $insideRequest);
     Assert::type('Bitbang\\Http\\Response', $insideResponse);
 }