2011-08-12 6 views
5

मेरे पास यह वर्ग है:PHPUnit- उत्पन्न कंकाल परीक्षण वर्ग: मूल वर्ग के बारे में त्रुटि

 
namespace MyFirm\PlatformBundle\Entity\Destination\Content; 

class Event extends Content   //this is line 18 
{ 
    ... 

मैं इसके माध्यम से अपनी कंकाल परीक्षण कक्षा उत्पन्न करने की कोशिश कर रहा हूं:

$ phpunit --skeleton-test "MyFirm\PlatformBundle\Entity\Destination\Content\Event" Event.php

लेकिन मुझे यह त्रुटि मिल रही है:

PHP Fatal error: Class 'MyFirm\PlatformBundle\Entity\Destination\Content\Content' not found in /home/me/mf/myfirm/src/MyFirm/PlatformBundle/Entity/Destination/Content/Event.php on line 18

यह सामग्री वर्ग है:

 
namespace MyFirm\PlatformBundle\Entity\Destination\Content; 

abstract class Content 
{ 
    ... 

मुझे सामग्री वर्ग के लिए पहले कंकाल परीक्षण कक्षा उत्पन्न करने में कोई समस्या नहीं थी।

कोई विचार?

php 5.3/phpunit 3.5

टैग: विरासत

उत्तर

3

जब तक आप वास्तविक फ़ाइलें है जो स्वत: लोड किया जा सकता करने के लिए अपने classnames हल करने PHPUnit आदेश नहीं बनाते हैं, इस काम नहीं करेगा क्योंकि फिलहाल फ़ाइल को कंकाल बनाने के लिए लोड किया गया है, MyFirm\PlatformBundle\Entity\Destination\Content\Content घोषित नहीं किया गया है।

अपनी प्रोजेक्ट ऑटोलोडर को बूटस्ट्रैप फ़ाइल में जोड़ें और इस बूटस्ट्रैप फ़ाइल को सक्षम करने वाले phpunit के साथ कंकाल फ़ाइलों का निर्माण करें। तब आपको यह घातक त्रुटि तब तक नहीं मिलेगी जब PHP MyFirm\PlatformBundle\Entity\Destination\Content\Content की घोषणा भी पा सके।

संबंधित मुद्दे