댓글 검색 목록

[php] PHPUnit은 프로그래머 중심의 PHP 용 테스트 프레임 워크입니다.

페이지 정보

작성자 운영자 작성일 21-01-22 10:46 조회 848 댓글 0

단위 테스트 프레임 워크를 위한 xUnit 아키텍처의 인스턴스입니다.


https://phpunit.de/


PHPUnit 9.5에는 PHP 7.3이 필요합니다. 최신 버전의 PHP를 사용하는 것이 좋습니다.


composer require --dev phpunit/phpunit ^9


<?php declare(strict_types=1); use PHPUnit\Framework\TestCase; final class EmailTest extends TestCase { public function testCanBeCreatedFromValidEmailAddress(): void { $this->assertInstanceOf( Email::class, Email::fromString('user@example.com') ); } public function testCannotBeCreatedFromInvalidEmailAddress(): void { $this->expectException(InvalidArgumentException::class); Email::fromString('invalid'); } public function testCanBeUsedAsString(): void { $this->assertEquals( 'user@example.com', Email::fromString('user@example.com') ); } } 




댓글목록 0

등록된 댓글이 없습니다.

웹학교 로고

온라인 코딩학교

코리아뉴스 2001 - , All right reserved.