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

  • DRDAnimation

    DRDAnimation

    28 EYLÜL 2012
  • HouseholdHacker

    HouseholdHac

    6 Kasım 2007
  • superemposed

    superemposed

    25 Aralık 2007