Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 8cc0737

Browse files
tarohidakuromoka
authored andcommitted
remove @ExpectedException, etc measure
1 parent 4c366d8 commit 8cc0737

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

src/writing-tests-for-phpunit.rst

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -677,48 +677,6 @@ PHPUnit はテストが実行される順序を変更しないので、
677677
``$expected`` のメッセージが含まれるかどうかを確かめるだけのものであり、
678678
完全一致するかどうかを確かめるわけではないことに注意しましょう。
679679

680-
別の方法として、``@expectedException``、
681-
``@expectedExceptionCode``、
682-
``@expectedExceptionMessage``、
683-
``@expectedExceptionMessageRegExp`` といったアノテーションでも、
684-
テスト対象のコードで発生するであろう例外をテストできます。
685-
:numref:`writing-tests-for-phpunit.exceptions.examples.ExceptionTest2.php`
686-
に例を示します。
687-
688-
.. code-block:: php
689-
:caption: @expectedException アノテーションの使用法
690-
:name: writing-tests-for-phpunit.exceptions.examples.ExceptionTest2.php
691-
692-
<?php
693-
use PHPUnit\Framework\TestCase;
694-
695-
class ExceptionTest extends TestCase
696-
{
697-
/**
698-
* @expectedException InvalidArgumentException
699-
*/
700-
public function testException()
701-
{
702-
}
703-
}
704-
705-
.. code-block:: bash
706-
707-
$ phpunit ExceptionTest
708-
PHPUnit |version|.0 by Sebastian Bergmann and contributors.
709-
710-
F
711-
712-
Time: 0 seconds, Memory: 4.75Mb
713-
714-
There was 1 failure:
715-
716-
1) ExceptionTest::testException
717-
Failed asserting that exception of type "InvalidArgumentException" is thrown.
718-
719-
FAILURES!
720-
Tests: 1, Assertions: 1, Failures: 1.
721-
722680
.. _writing-tests-for-phpunit.errors:
723681

724682
PHP のエラーのテスト

0 commit comments

Comments
 (0)