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

  • BaaaStuds's channel

    BaaaStuds's

    10 Mart 2009
  • Dive In

    Dive In

    17 Temmuz 2013
  • kindlechatmail

    kindlechatma

    25 AĞUSTOS 2010