Changeset 851

Show
Ignore:
Timestamp:
08/20/07 20:42:57 (1 year ago)
Author:
schst
Message:

Fixed bug #72, moved stubXMLSerializer tests to their correct location, added tests for stubXMLMatcherAnnotation

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/net/stubbles/xml/serializer/annotations/stubXMLMatcherAnnotation.php

    r432 r851  
    4848    public function getTagnameForProperty(stubReflectionProperty $property, $propertyValue) { 
    4949        $matches = array(); 
    50         if (!preg_match($this->pattern, $property->getName(), $matches)) { 
     50        $success = @preg_match($this->pattern, $property->getName(), $matches); 
     51        if ($success === false) { 
     52            throw new stubXMLException("Syntax error in regular expression '{$this->pattern}': {$php_errormsg}"); 
     53        } 
     54        if (empty($matches)) { 
    5155            return false; 
    5256        } 
     
    6569    public function getTagnameForMethod(stubReflectionMethod $method, $returnValue) { 
    6670        $matches = array(); 
    67         if (!preg_match($this->pattern, $method->getName(), $matches)) { 
     71        $success = preg_match($this->pattern, $method->getName(), $matches); 
     72        if ($success === false) { 
     73            throw new stubXMLException("Syntax error in regular expression '{$this->pattern}': {$php_errormsg}"); 
     74        } 
     75        if (empty($matches)) { 
    6876            return false; 
    6977        } 
  • trunk/src/test/php/net/stubbles/xml/XMLTestSuite.php

    r730 r851  
    2626        $this->addTestFile($dir . '/stubDomXMLStreamWriterTestCase.php'); 
    2727        $this->addTestFile($dir . '/stubLibXmlXMLStreamWriterTestCase.php'); 
    28         $this->addTestFile($dir . '/stubXMLSerializerTestCase.php'); 
    29         $this->addTestFile($dir . '/stubXMLSerializerStrategyTestCase.php'); 
     28 
     29        // serializer 
     30        $this->addTestFile($dir . '/serializer/stubXMLSerializerTestCase.php'); 
     31        $this->addTestFile($dir . '/serializer/stubXMLSerializerStrategyTestCase.php'); 
     32        $this->addTestFile($dir . '/serializer/annotations/stubXMLMatcherAnnotationTestCase.php'); 
    3033 
    3134        // rss