Documentation

WebTestCase extends KernelTestCase
in package
Uses WebTestAssertionsTrait

WebTestCase is the base class for functional tests.

Tags
author

Fabien Potencier fabien@symfony.com

Table of Contents

$booted  : mixed
$class  : mixed
$container  : ContainerInterface
$kernel  : KernelInterface
assertEmailAddressContains()  : void
assertEmailAttachmentCount()  : void
assertEmailCount()  : void
assertEmailHasHeader()  : void
assertEmailHeaderNotSame()  : void
assertEmailHeaderSame()  : void
assertEmailHtmlBodyContains()  : void
assertEmailHtmlBodyNotContains()  : void
assertEmailIsNotQueued()  : void
assertEmailIsQueued()  : void
assertEmailNotHasHeader()  : void
assertEmailTextBodyContains()  : void
assertEmailTextBodyNotContains()  : void
assertQueuedEmailCount()  : void
getMailerEvent()  : MessageEvent|null
getMailerEvents()  : array<string|int, MessageEvent>
getMailerMessage()  : RawMessage|null
getMailerMessages()  : array<string|int, RawMessage>
bootKernel()  : KernelInterface
Boots the Kernel for this test.
createClient()  : KernelBrowser
Creates a KernelBrowser.
createKernel()  : KernelInterface
Creates a Kernel.
ensureKernelShutdown()  : mixed
Shuts the kernel down if it was used in the test - called by the tearDown method by default.
getContainer()  : ContainerInterface
Provides a dedicated test container with access to both public and private services. The container will not include private services that have been inlined or removed. Private services will be removed when they are not used by other services.
getKernelClass()  : string
tearDown()  : void
getMessageMailerEvents()  : MessageEvents

Properties

Methods

assertEmailAddressContains()

public static assertEmailAddressContains(RawMessage $email, string $headerName, string $expectedValue[, string $message = '' ]) : void
Parameters
$email : RawMessage
$headerName : string
$expectedValue : string
$message : string = ''
Return values
void

assertEmailAttachmentCount()

public static assertEmailAttachmentCount(RawMessage $email, int $count[, string $message = '' ]) : void
Parameters
$email : RawMessage
$count : int
$message : string = ''
Return values
void

assertEmailCount()

public static assertEmailCount(int $count[, string|null $transport = null ][, string $message = '' ]) : void
Parameters
$count : int
$transport : string|null = null
$message : string = ''
Return values
void

assertEmailHasHeader()

public static assertEmailHasHeader(RawMessage $email, string $headerName[, string $message = '' ]) : void
Parameters
$email : RawMessage
$headerName : string
$message : string = ''
Return values
void

assertEmailHeaderNotSame()

public static assertEmailHeaderNotSame(RawMessage $email, string $headerName, string $expectedValue[, string $message = '' ]) : void
Parameters
$email : RawMessage
$headerName : string
$expectedValue : string
$message : string = ''
Return values
void

assertEmailHeaderSame()

public static assertEmailHeaderSame(RawMessage $email, string $headerName, string $expectedValue[, string $message = '' ]) : void
Parameters
$email : RawMessage
$headerName : string
$expectedValue : string
$message : string = ''
Return values
void

assertEmailHtmlBodyContains()

public static assertEmailHtmlBodyContains(RawMessage $email, string $text[, string $message = '' ]) : void
Parameters
$email : RawMessage
$text : string
$message : string = ''
Return values
void

assertEmailHtmlBodyNotContains()

public static assertEmailHtmlBodyNotContains(RawMessage $email, string $text[, string $message = '' ]) : void
Parameters
$email : RawMessage
$text : string
$message : string = ''
Return values
void

assertEmailIsNotQueued()

public static assertEmailIsNotQueued(MessageEvent $event[, string $message = '' ]) : void
Parameters
$event : MessageEvent
$message : string = ''
Return values
void

assertEmailIsQueued()

public static assertEmailIsQueued(MessageEvent $event[, string $message = '' ]) : void
Parameters
$event : MessageEvent
$message : string = ''
Return values
void

assertEmailNotHasHeader()

public static assertEmailNotHasHeader(RawMessage $email, string $headerName[, string $message = '' ]) : void
Parameters
$email : RawMessage
$headerName : string
$message : string = ''
Return values
void

assertEmailTextBodyContains()

public static assertEmailTextBodyContains(RawMessage $email, string $text[, string $message = '' ]) : void
Parameters
$email : RawMessage
$text : string
$message : string = ''
Return values
void

assertEmailTextBodyNotContains()

public static assertEmailTextBodyNotContains(RawMessage $email, string $text[, string $message = '' ]) : void
Parameters
$email : RawMessage
$text : string
$message : string = ''
Return values
void

assertQueuedEmailCount()

public static assertQueuedEmailCount(int $count[, string|null $transport = null ][, string $message = '' ]) : void
Parameters
$count : int
$transport : string|null = null
$message : string = ''
Return values
void

getMailerEvent()

public static getMailerEvent(int $index[, string|null $transport = null ]) : MessageEvent|null
Parameters
$index : int
$transport : string|null = null
Return values
MessageEvent|null

getMailerEvents()

public static getMailerEvents([string|null $transport = null ]) : array<string|int, MessageEvent>
Parameters
$transport : string|null = null
Return values
array<string|int, MessageEvent>

getMailerMessage()

public static getMailerMessage(int $index[, string|null $transport = null ]) : RawMessage|null
Parameters
$index : int
$transport : string|null = null
Return values
RawMessage|null

getMailerMessages()

public static getMailerMessages([string|null $transport = null ]) : array<string|int, RawMessage>
Parameters
$transport : string|null = null
Return values
array<string|int, RawMessage>

bootKernel()

Boots the Kernel for this test.

protected static bootKernel([array<string|int, mixed> $options = [] ]) : KernelInterface
Parameters
$options : array<string|int, mixed> = []
Return values
KernelInterface

createClient()

Creates a KernelBrowser.

protected static createClient([array<string|int, mixed> $options = [] ][, array<string|int, mixed> $server = [] ]) : KernelBrowser
Parameters
$options : array<string|int, mixed> = []

An array of options to pass to the createKernel method

$server : array<string|int, mixed> = []

An array of server parameters

Return values
KernelBrowser

createKernel()

Creates a Kernel.

protected static createKernel([array<string|int, mixed> $options = [] ]) : KernelInterface

Available options:

  • environment
  • debug
Parameters
$options : array<string|int, mixed> = []
Return values
KernelInterface

ensureKernelShutdown()

Shuts the kernel down if it was used in the test - called by the tearDown method by default.

protected static ensureKernelShutdown() : mixed
Return values
mixed

getContainer()

Provides a dedicated test container with access to both public and private services. The container will not include private services that have been inlined or removed. Private services will be removed when they are not used by other services.

protected static getContainer() : ContainerInterface

Using this method is the best way to get a container from your test code.

Return values
ContainerInterface

getKernelClass()

protected static getKernelClass() : string
Tags
throws
RuntimeException
throws
LogicException
Return values
string

tearDown()

protected tearDown() : void
Return values
void

getMessageMailerEvents()

private static getMessageMailerEvents() : MessageEvents
Return values
MessageEvents

Search results