Skip to content

Instantly share code, notes, and snippets.

@gquemener
Last active January 4, 2016 06:29
Show Gist options
  • Save gquemener/8582134 to your computer and use it in GitHub Desktop.
Save gquemener/8582134 to your computer and use it in GitHub Desktop.
Bug with PhpSpec JUnit Formatter
<?xml version="1.0"?>
<testsuites>
<testsuite name="Pim\Bundle\CatalogBundle\Manager\LocaleManager" id="/home/gildas/projects/pim/spec/Pim/Bundle/CatalogBundle/Manager/LocaleManagerSpec.php" tests="12" failures="0" errors="0" time="0.11581373214722">
<testcase name="provides locale from the request if it has been set" classname="Pim\Bundle\CatalogBundle\Manager\LocaleManager" time="0.031787157058716"/>
</testsuite>
</testsuites>
<?xml version="1.0"?>
<testsuites>
<testsuite name="Pim\Bundle\CatalogBundle\Manager\LocaleManager" file="/home/gildas/projects/pim/spec/Pim/Bundle/CatalogBundle/Manager/LocaleManagerSpec.php" tests="12" assertions="0" failures="0" errors="0" time="0.11581373214722">
<testcase name="provides locale from the request if it has been set" class="Pim\Bundle\CatalogBundle\Manager\LocaleManager" file="/home/gildas/projects/pim/spec/Pim/Bundle/CatalogBundle/Manager/LocaleManagerSpec.php" line="26" assertions="0" time="0.031787157058716"/>
<testcase name="provides default locale if request has not been set" class="Pim\Bundle\CatalogBundle\Manager\LocaleManager" file="/home/gildas/projects/pim/spec/Pim/Bundle/CatalogBundle/Manager/LocaleManagerSpec.php" line="34" assertions="0" time="0.004429817199707"/>
<testcase name="provides active locales" class="Pim\Bundle\CatalogBundle\Manager\LocaleManager" file="/home/gildas/projects/pim/spec/Pim/Bundle/CatalogBundle/Manager/LocaleManagerSpec.php" line="39" assertions="0" time="0.0079348087310791"/>
<testcase name="provides deactivated locales" class="Pim\Bundle\CatalogBundle\Manager\LocaleManager" file="/home/gildas/projects/pim/spec/Pim/Bundle/CatalogBundle/Manager/LocaleManagerSpec.php" line="46" assertions="0" time="0.0063409805297852"/>
<testcase name="provides locales by criteria" class="Pim\Bundle\CatalogBundle\Manager\LocaleManager" file="/home/gildas/projects/pim/spec/Pim/Bundle/CatalogBundle/Manager/LocaleManagerSpec.php" line="53" assertions="0" time="0.0062670707702637"/>
<testcase name="provides a locale by its code" class="Pim\Bundle\CatalogBundle\Manager\LocaleManager" file="/home/gildas/projects/pim/spec/Pim/Bundle/CatalogBundle/Manager/LocaleManagerSpec.php" line="60" assertions="0" time="0.0059559345245361"/>
<testcase name="provides active locales codes" class="Pim\Bundle\CatalogBundle\Manager\LocaleManager" file="/home/gildas/projects/pim/spec/Pim/Bundle/CatalogBundle/Manager/LocaleManagerSpec.php" line="67" assertions="0" time="0.0072259902954102"/>
<testcase name="provides active locales for which current user has access" class="Pim\Bundle\CatalogBundle\Manager\LocaleManager" file="/home/gildas/projects/pim/spec/Pim/Bundle/CatalogBundle/Manager/LocaleManagerSpec.php" line="76" assertions="0" time="0.0079789161682129"/>
<testcase name="provides active locales codes for which current user has access" class="Pim\Bundle\CatalogBundle\Manager\LocaleManager" file="/home/gildas/projects/pim/spec/Pim/Bundle/CatalogBundle/Manager/LocaleManagerSpec.php" line="87" assertions="0" time="0.009058952331543"/>
<testcase name="provides available fallback locales" class="Pim\Bundle\CatalogBundle\Manager\LocaleManager" file="/home/gildas/projects/pim/spec/Pim/Bundle/CatalogBundle/Manager/LocaleManagerSpec.php" line="102" assertions="0" time="0.0073390007019043"/>
<testcase name="provides data locale from the request query" class="Pim\Bundle\CatalogBundle\Manager\LocaleManager" file="/home/gildas/projects/pim/spec/Pim/Bundle/CatalogBundle/Manager/LocaleManagerSpec.php" line="111" assertions="0" time="0.010967969894409"/>
<testcase name="its getDataLocale throws exception when data locale is not activated or accessible" class="Pim\Bundle\CatalogBundle\Manager\LocaleManager" file="/home/gildas/projects/pim/spec/Pim/Bundle/CatalogBundle/Manager/LocaleManagerSpec.php" line="126" assertions="0" time="0.01052713394165"/>
</testsuite>
</testsuites>
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!--
This is the junit xsd used by Behat (https://github.com/Behat/Behat/blob/2.5/src/Behat/Behat/Formatter/JUnitFormatter.php#L358)
https://svn.jenkins-ci.org/trunk/hudson/dtkit/dtkit-format/dtkit-junit-model/src/main/resources/com/thalesgroup/dtkit/junit/model/xsd/junit-4.xsd
-->
<xs:element name="failure">
<xs:complexType mixed="true">
<xs:attribute name="type" type="xs:string" use="optional"/>
<xs:attribute name="message" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="error">
<xs:complexType mixed="true">
<xs:attribute name="type" type="xs:string" use="optional"/>
<xs:attribute name="message" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="properties">
<xs:complexType>
<xs:sequence>
<xs:element ref="property" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="property">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="value" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="skipped" type="xs:string"/>
<xs:element name="system-err" type="xs:string"/>
<xs:element name="system-out" type="xs:string"/>
<xs:element name="testcase">
<xs:complexType>
<xs:sequence>
<xs:element ref="skipped" minOccurs="0" maxOccurs="1"/>
<xs:element ref="error" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="failure" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="system-out" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="system-err" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="assertions" type="xs:string" use="optional"/>
<xs:attribute name="time" type="xs:string" use="optional"/>
<xs:attribute name="classname" type="xs:string" use="optional"/>
<xs:attribute name="status" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="testsuite">
<xs:complexType>
<xs:sequence>
<xs:element ref="properties" minOccurs="0" maxOccurs="1"/>
<xs:element ref="testcase" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="system-out" minOccurs="0" maxOccurs="1"/>
<xs:element ref="system-err" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="tests" type="xs:string" use="required"/>
<xs:attribute name="failures" type="xs:string" use="optional"/>
<xs:attribute name="errors" type="xs:string" use="optional"/>
<xs:attribute name="time" type="xs:string" use="optional"/>
<xs:attribute name="disabled" type="xs:string" use="optional"/>
<xs:attribute name="skipped" type="xs:string" use="optional"/>
<xs:attribute name="timestamp" type="xs:string" use="optional"/>
<xs:attribute name="hostname" type="xs:string" use="optional"/>
<xs:attribute name="id" type="xs:string" use="optional"/>
<xs:attribute name="package" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="testsuites">
<xs:complexType>
<xs:sequence>
<xs:element ref="testsuite" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="optional"/>
<xs:attribute name="time" type="xs:string" use="optional"/>
<xs:attribute name="tests" type="xs:string" use="optional"/>
<xs:attribute name="failures" type="xs:string" use="optional"/>
<xs:attribute name="disabled" type="xs:string" use="optional"/>
<xs:attribute name="errors" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
</xs:schema>
➜ php test.php
PHP Warning: DOMDocument::schemaValidate(): Element 'testsuite', attribute 'file': The attribute 'file' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testsuite', attribute 'assertions': The attribute 'assertions' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'class': The attribute 'class' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'file': The attribute 'file' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'line': The attribute 'line' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'class': The attribute 'class' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'file': The attribute 'file' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'line': The attribute 'line' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'class': The attribute 'class' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'file': The attribute 'file' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'line': The attribute 'line' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'class': The attribute 'class' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'file': The attribute 'file' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'line': The attribute 'line' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'class': The attribute 'class' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'file': The attribute 'file' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'line': The attribute 'line' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'class': The attribute 'class' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'file': The attribute 'file' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'line': The attribute 'line' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'class': The attribute 'class' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'file': The attribute 'file' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'line': The attribute 'line' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'class': The attribute 'class' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'file': The attribute 'file' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'line': The attribute 'line' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'class': The attribute 'class' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'file': The attribute 'file' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'line': The attribute 'line' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'class': The attribute 'class' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'file': The attribute 'file' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'line': The attribute 'line' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'class': The attribute 'class' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'file': The attribute 'file' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'line': The attribute 'line' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'class': The attribute 'class' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'file': The attribute 'file' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
PHP Warning: DOMDocument::schemaValidate(): Element 'testcase', attribute 'line': The attribute 'line' is not allowed. in /home/gildas/projects/phpspec-junit/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /home/gildas/projects/phpspec-junit/test.php:0
PHP 2. DOMDocument->schemaValidate() /home/gildas/projects/phpspec-junit/test.php:5
bool(false)
<?php
$xml = new \DOMDocument();
$xml->load('junit.valid.xml');
var_dump($xml->schemaValidate('junit.xsd'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment