class TestClass extends Producer

Testklasse

Mit Hilfe dieser Klasse lässt sich das Template für einen UnitTest erstellen, der bereits alle Methoden und auch einige Funktionen enthält.

$source = new \Alvine\Development\Upkeep\Source $source;
$testclass = new \Alvine\Development\Upkeep\Producer\TestClass($source);

echo (string)$testclass;

Properties

protected ClassStructure $structure from Producer
protected string $description from Producer
protected MailAddress $author from Producer
protected string $license from Producer
protected string $category from Producer
protected string $className
protected Array $classProperty
protected string $getterTemplate
protected string $setterTemplate
protected string $namespace
protected ClassStructure $testStructure

Methods

__construct(Source $source)

Neue Klasse anlegen

initDefaultTags()

Standardwerte für die Tags

from Producer
initStructure(Source $source)

Initialisierung der Struktur

from Producer
setDescription(string $description)

Beschreibung

from Producer
setAuthor(MailAddress $author)

Autor

from Producer
setLicense(string $license)

Lizenz

from Producer
setCategory(string $category)

Kategory

from Producer
string
getNamespace()

Namensraum

string
getClassName()

Klassenname

createSetup()

Setup-Methode in die Struktur einhängen

string
getCodeForSetMethod(Method $method)

Quelltext

string
getCodeForGetMethod(Method $method)

Quelltext

string
getCodeForIsMethod(Method $method)

Quelltext

string
getCodeForDefaultMethod(Method $method)

Quelltext

createTestMethod(Method $method)

Tesfälle in die Struktur einhängen

createTests()

Test erstellen

initDefaultTest(Source $source)

Test initialisieren

getSource()

Quelltext erstellen

string
__toString()

Quelltext als Zeichenkette

Details

at line 86
__construct(Source $source)

Neue Klasse anlegen

Parameters

Source $source Quelltext

Exceptions

SourceException

in Producer at line 87
protected Producer initDefaultTags()

Standardwerte für die Tags

Diese Methode kann von abgeleiteten Klassen überschrieben werden.

Return Value

Producer

in Producer at line 102
Producer initStructure(Source $source)

Initialisierung der Struktur

Initialisiert die Klasse mit Werten aus einer Quelldatei

Parameters

Source $source

Return Value

Producer

in Producer at line 113
setDescription(string $description)

Beschreibung

Parameters

string $description Beschreibung

in Producer at line 123
setAuthor(MailAddress $author)

Autor

Parameters

MailAddress $author Autor

in Producer at line 133
setLicense(string $license)

Lizenz

Parameters

string $license Lizenz

in Producer at line 143
setCategory(string $category)

Kategory

Parameters

string $category Kategory

at line 112
string getNamespace()

Namensraum

Return Value

string Namensraum

at line 121
string getClassName()

Klassenname

Return Value

string Klassenname

at line 130
protected TestClass createSetup()

Setup-Methode in die Struktur einhängen

Return Value

TestClass

at line 158
protected string getCodeForSetMethod(Method $method)

Quelltext

Liefert Quelltext für Setter

Parameters

Method $method Methode

Return Value

string Code

at line 171
protected string getCodeForGetMethod(Method $method)

Quelltext

Liefert Quelltext für Getter

Parameters

Method $method Methode

Return Value

string Code

at line 184
protected string getCodeForIsMethod(Method $method)

Quelltext

Liefert Quelltext für Boolean-Methoden

Parameters

Method $method Methode

Return Value

string Code

at line 202
protected string getCodeForDefaultMethod(Method $method)

Quelltext

Liefert Quelltext für Standardtests

Parameters

Method $method Methode

Return Value

string Code

at line 228
protected TestClass createTestMethod(Method $method)

Tesfälle in die Struktur einhängen

Parameters

Method $method Methoden

Return Value

TestClass

at line 286
protected TestClass createTests()

Test erstellen

Return Value

TestClass

at line 304
TestClass initDefaultTest(Source $source)

Test initialisieren

Initialisierung eines Tests mit einer bestehenden Version des Tests.

Parameters

Source $source Quelltext

Return Value

TestClass

at line 316
Source getSource()

Quelltext erstellen

Return Value

Source Quelltextobjekt

at line 337
string __toString()

Quelltext als Zeichenkette

Return Value

string Zeichenkette