PHPUnitManual:6.1

From 흡혈양파의 번역工房
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
6.1 tearDown() 보다 setUp()

setUp() 과 tearDown() 은 대칭적인 개념입니다만, 실제로는 tearDown() 을 구현할 필요가 있는 것은 setUp() 에서 외부 리소스 (파일이나 소켓 등) 을 할당했을 때 뿐입니다. setUp() 에서 단순히 PHP 오브젝트를 작성한 경우, 일반적으로 tearDown() 은 필요하지 않습니다. 그러지만, setUp() 에서 대량의 오브젝트를 작성한 경우, tearDown() 에서 변수들을 unset() 하는 게 좋은 경우도 있습니다. 테스트 케이스 오브젝트 자체의 gabage collection 은 큰 의미가 없습니다.


Notes