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

  • Kanaal van Dj0fifty

    Kanaal van D

    28 EKİM 2011
  • Lamarr Wilson

    Lamarr Wilso

    27 Aralık 2008
  • Malwarebytes

    Malwarebytes

    22 Temmuz 2007