phpunitxml

package
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2025 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const OutputPHPUnitXML = "phpunitxml_generated_by_puco.xml"
View Source
const PHPUnitXMLPath = "phpunit.xml"

Variables

This section is empty.

Functions

func Generate

func Generate(commandToSpecifyBeforePHPCommand string, targetTests []string, targetCoverageDir string) error

Types

type Clover

type Clover struct {
	OutputFile string `xml:"outputFile,attr"`
}

Clover <clover outputFile="...">

type Const

type Const struct {
	Name  string `xml:"name,attr"`
	Value string `xml:"value,attr"`
}

Const <const name="..." value="...">

type Coverage

type Coverage struct {
	Include IncludeExclude `xml:"include,omitempty"`
	Exclude IncludeExclude `xml:"exclude,omitempty"`
	Report  Report         `xml:"report,omitempty"`
}

Coverage <coverage>

type Directory

type Directory struct {
	Suffix  string `xml:"suffix,attr,omitempty"`
	Content string `xml:",chardata"`
}

Directory <directory suffix="...">

type Env

type Env struct {
	Name  string `xml:"name,attr"`
	Value string `xml:"value,attr"`
	Force string `xml:"force,attr,omitempty"`
}

Env <env name="..." value="...">

type ErrReadPHPUnitXML

type ErrReadPHPUnitXML struct {
	// contains filtered or unexported fields
}

func (*ErrReadPHPUnitXML) Error

func (e *ErrReadPHPUnitXML) Error() string

type Exclude

type Exclude struct {
	Content string `xml:",chardata"`
}

Exclude <exclude>

type ExtensionBootstrap

type ExtensionBootstrap struct {
	Class string `xml:"class,attr"`
}

ExtensionBootstrap <bootstrap class="...">

type Extensions

type Extensions struct {
	Bootstrap []ExtensionBootstrap `xml:"bootstrap"`
}

Extensions <extensions>

type File

type File struct {
	Content string `xml:",chardata"`
}

File <file>

type Group

type Group struct {
	Name string `xml:",chardata"`
}

Group <group>

type Groups

type Groups struct {
	Exclude []Group `xml:"exclude>group,omitempty"`
}

Groups <groups>

type IncludeExclude

type IncludeExclude struct {
	Directories []Directory `xml:"directory,omitempty"`
	Files       []File      `xml:"file,omitempty"`
}

IncludeExclude <include> / <exclude> (coverage用)

type IncludePath

type IncludePath struct {
	Content string `xml:",chardata"`
}

IncludePath <includePath>

type Ini

type Ini struct {
	Name  string `xml:"name,attr"`
	Value string `xml:"value,attr"`
}

Ini <ini name="..." value="...">

type Listener

type Listener struct {
	Class     string             `xml:"class,attr"`
	File      string             `xml:"file,attr,omitempty"`
	Arguments []ListenerArgument `xml:"arguments>argument,omitempty"`
}

Listener <listener class="...">

type ListenerArgument

type ListenerArgument struct {
	Content string `xml:",chardata"`
	Type    string `xml:"type,attr,omitempty"`
}

ListenerArgument <argument>

type Listeners

type Listeners struct {
	Listener []Listener `xml:"listener,omitempty"`
}

Listeners <listeners>

type Logging

type Logging struct {
}

Logging <logging>

type PHPUnitXML

type PHPUnitXML struct {
	XMLName xml.Name `xml:"phpunit"`

	// --- ネームスペース属性(必須) ---
	XmlnsXsi                     string `xml:"xmlns:xsi,attr"`
	XsiNoNamespaceSchemaLocation string `xml:"xsi:noNamespaceSchemaLocation,attr"`

	// --- ルートの属性 ---
	Bootstrap                           string `xml:"bootstrap,attr,omitempty"`
	CacheResult                         string `xml:"cacheResult,attr,omitempty"`
	Colors                              string `xml:"colors,attr,omitempty"`
	ExecutionOrder                      string `xml:"executionOrder,attr,omitempty"`
	FailOnRisky                         string `xml:"failOnRisky,attr,omitempty"`
	FailOnWarning                       string `xml:"failOnWarning,attr,omitempty"`
	FailOnEmptyTestSuite                string `xml:"failOnEmptyTestSuite,attr,omitempty"`
	BeStrictAboutChangesToGlobalState   string `xml:"beStrictAboutChangesToGlobalState,attr,omitempty"`
	BeStrictAboutOutputDuringTests      string `xml:"beStrictAboutOutputDuringTests,attr,omitempty"`
	CacheDirectory                      string `xml:"cacheDirectory,attr,omitempty"`
	BeStrictAboutCoverageMetadata       string `xml:"beStrictAboutCoverageMetadata,attr,omitempty"`
	DisplayDetailsOnPhpunitDeprecations string `xml:"displayDetailsOnPhpunitDeprecations,attr,omitempty"`
	DisplayDetailsOnIncompleteTests     string `xml:"displayDetailsOnIncompleteTests,attr,omitempty"`
	StopOnFailure                       string `xml:"stopOnFailure,attr,omitempty"`

	// --- 主要な子要素(ポインタやスライスでオプションとして定義) ---
	Extensions *Extensions `xml:"extensions,omitempty"`
	TestSuites *TestSuites `xml:"testsuites,omitempty"`
	Groups     *Groups     `xml:"groups,omitempty"`

	// ここphpunit versionで変わる<coverage><source>とか. <filter>もどこかある?
	Coverage *Coverage `xml:"coverage,omitempty"`
	Source   *Source   `xml:"source,omitempty"`

	Php       *Php       `xml:"php,omitempty"`
	Listeners *Listeners `xml:"listeners,omitempty"`
	// Loggingは通常空タグだが、子要素を持つことも可能
	Logging *Logging `xml:"logging,omitempty"`
}

PHPUnitXML - ルート要素 <phpunit ...>

type Php

type Php struct {
	Ini         []Ini         `xml:"ini,omitempty"`
	Env         []Env         `xml:"env,omitempty"`
	Const       []Const       `xml:"const,omitempty"`
	IncludePath []IncludePath `xml:"includePath,omitempty"`
}

Php <php>

type Report

type Report struct {
	Clover *Clover `xml:"clover,omitempty"`
}

Report <report>

type Source

type Source struct {
	Include IncludeExclude `xml:"include,omitempty"`
	Exclude IncludeExclude `xml:"exclude,omitempty"`
}

type TestSuite

type TestSuite struct {
	Name        string      `xml:"name,attr"`
	Files       []File      `xml:"file,omitempty"`
	Directories []Directory `xml:"directory,omitempty"`
	Excludes    []Exclude   `xml:"exclude,omitempty"`
}

TestSuite <testsuite name="...">

type TestSuites

type TestSuites struct {
	TestSuite []TestSuite `xml:"testsuite"`
}

TestSuites <testsuites>

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL