์๋
ํ์ญ๋๊น,
bin/phpunit -c app/src/MyBundle/Tests/Controller/TestControllerTest.php๋ฅผ ์ฌ์ฉํ์ฌ ์คํํ์ ๋
๋ค์ ์ค๋ฅ๊ฐ ๋ฐ์ํ๋ฉด ์ฌ๋ฌ ๊ฐ์ง ๋ฐฉ๋ฒ์ ์ฐพ์์ง๋ง ์ด์ ๋ํ ํด๊ฒฐ์ฑ
์ด ์์์ต๋๋ค.
1) MyBundleTests\ControllerTestControllerTest::testJsonPutTestActionShouldModify
PHPUnit_Framework_Exception: PHP ์น๋ช
์ ์ธ ์ค๋ฅ: C:\Users\php52AppD์์ 'PDO ์ธ์คํด์ค๋ฅผ ์ง๋ ฌํํ๊ฑฐ๋ ์ง๋ ฌํ ํด์ ํ ์ ์์ต๋๋ค'๋ผ๋ ๋ฉ์์ง์ ํจ๊ป ์กํ์ง ์์ ์์ธ 'PDOException'
ata\LocalTemp\PHPB2A7. ์๊ฐ:49
์คํ ์ถ์ :
49ํ์ C:\Users\php52AppData\LocalTemp\PHPB2A7.tmp์ ๋์ ธ์ก์ต๋๋ค.
๊ฐ์ฌ ํด์
์ง๋ ฌํ๋ฅผ ์ง์ํ์ง ์๋ ๊ฐ์ฒด(์: PDO ๊ฐ์ฒด)๋ฅผ ํ ์คํธํ๋ ค๋ฉด ํ๋ก์ธ์ค ๊ฒฉ๋ฆฌ๋ฅผ ๋นํ์ฑํํด์ผ ํฉ๋๋ค.
@whatthejeff
์ง๋ ฌํ๋ฅผ ์ง์ํ์ง ์๋ ๊ฐ์ฒด(์: PDO ๊ฐ์ฒด)๋ฅผ ํ ์คํธํ๋ ค๋ฉด ํ๋ก์ธ์ค ๊ฒฉ๋ฆฌ๋ฅผ ๋นํ์ฑํํด์ผ ํฉ๋๋ค.
๊ทธ๋ ๊ฒํ๋ ๋ฐฉ๋ฒ ?
์ผ์ง์ง ์์ :-) ๊ธฐ๋ณธ์ ์ผ๋ก ๋นํ์ฑํ๋์ด ์์ต๋๋ค.
๋ค, ์์๋์ด์ ;) .์ฌ์ค ๋ด symfony2 ํ๋ก์ ํธ์์ phpunit.xml.dist์์ ํ์ฑํ๋์์ต๋๋ค.
backupGlobals = "๊ฑฐ์ง"
processIsolation = "์ฐธ"
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
์ง๋ ฌํ๋ฅผ ์ง์ํ์ง ์๋ ๊ฐ์ฒด(์: PDO ๊ฐ์ฒด)๋ฅผ ํ ์คํธํ๋ ค๋ฉด ํ๋ก์ธ์ค ๊ฒฉ๋ฆฌ๋ฅผ ๋นํ์ฑํํด์ผ ํฉ๋๋ค.