SORU
16 NİSAN 2011, CUMARTESİ


PHPUnit bir özel durum olduğunu düşünüyor.

Kimse assert veya bir özel durum kodu test atıldı olup olmadığını test edebilirsiniz böyle bir şey olup olmadığını biliyor mu?

CEVAP
16 NİSAN 2011, CUMARTESİ


http://phpunit.de/manual/current/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.exceptions.examples.ExceptionTest.php

<?php
require_once 'PHPUnit/Framework.php';

class ExceptionTest extends PHPUnit_Framework_TestCase
{
    public function testException()
    {
        $this->setExpectedException('InvalidArgumentException');
    }
}

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • AlaskanGrizzly

    AlaskanGrizz

    30 EKİM 2009
  • BumbleDroid

    BumbleDroid

    18 EKİM 2010
  • jocc talking shit

    jocc talking

    6 NİSAN 2007