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

  • Ampisound

    Ampisound

    12 Kasım 2006
  • bobono1baby

    bobono1baby

    14 AĞUSTOS 2011
  • Theodore Leaf

    Theodore Lea

    29 AĞUSTOS 2006