testing

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2024 License: MIT Imports: 25 Imported by: 9

Documentation

Index

Constants

View Source
const Binding = "goravel.testing"

Variables

This section is empty.

Functions

func NewAssertableJSON added in v1.15.0

func NewAssertableJSON(t *testing.T, jsonStr string) (contractstesting.AssertableJSON, error)

func NewTestRequest added in v1.15.0

func NewTestRequest(t *testing.T) contractstesting.TestRequest

func NewTestResponse added in v1.15.0

func NewTestResponse(t *testing.T, response *http.Response) contractstesting.TestResponse

Types

type Application added in v1.13.0

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

func NewApplication added in v1.13.0

func NewApplication(app foundation.Application) *Application

func (*Application) Docker added in v1.13.0

func (receiver *Application) Docker() testing.Docker

type AssertableJson added in v1.15.0

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

func (*AssertableJson) Count added in v1.15.0

func (*AssertableJson) Each added in v1.15.0

func (*AssertableJson) First added in v1.15.0

func (*AssertableJson) Has added in v1.15.0

func (*AssertableJson) HasAll added in v1.15.0

func (*AssertableJson) HasAny added in v1.15.0

func (*AssertableJson) HasWithScope added in v1.15.0

func (r *AssertableJson) HasWithScope(key string, length int, callback func(contractstesting.AssertableJSON)) contractstesting.AssertableJSON

func (*AssertableJson) Json added in v1.15.0

func (r *AssertableJson) Json() map[string]any

func (*AssertableJson) Missing added in v1.15.0

func (*AssertableJson) MissingAll added in v1.15.0

func (r *AssertableJson) MissingAll(keys []string) contractstesting.AssertableJSON

func (*AssertableJson) Where added in v1.15.0

func (*AssertableJson) WhereNot added in v1.15.0

func (r *AssertableJson) WhereNot(key string, value any) contractstesting.AssertableJSON

type ServiceProvider added in v1.13.0

type ServiceProvider struct {
}

func (*ServiceProvider) Boot added in v1.13.0

func (receiver *ServiceProvider) Boot(app foundation.Application)

func (*ServiceProvider) Register added in v1.13.0

func (receiver *ServiceProvider) Register(app foundation.Application)

type TestCase added in v1.13.0

type TestCase struct {
}

func (*TestCase) Http added in v1.15.0

func (*TestCase) RefreshDatabase added in v1.13.0

func (r *TestCase) RefreshDatabase(seeders ...contractsseeder.Seeder)

func (*TestCase) Seed added in v1.13.0

func (r *TestCase) Seed(seeders ...contractsseeder.Seeder)

type TestRequest added in v1.15.0

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

func (*TestRequest) Bind added in v1.15.0

func (*TestRequest) Delete added in v1.15.0

func (r *TestRequest) Delete(uri string, body io.Reader) (contractstesting.TestResponse, error)

func (*TestRequest) FlushHeaders added in v1.15.0

func (r *TestRequest) FlushHeaders() contractstesting.TestRequest

func (*TestRequest) Get added in v1.15.0

func (*TestRequest) Head added in v1.15.0

func (*TestRequest) Options added in v1.15.0

func (*TestRequest) Patch added in v1.15.0

func (*TestRequest) Post added in v1.15.0

func (*TestRequest) Put added in v1.15.0

func (*TestRequest) WithBasicAuth added in v1.15.0

func (r *TestRequest) WithBasicAuth(username, password string) contractstesting.TestRequest

func (*TestRequest) WithContext added in v1.15.0

func (*TestRequest) WithCookie added in v1.15.0

func (r *TestRequest) WithCookie(key, value string) contractstesting.TestRequest

func (*TestRequest) WithCookies added in v1.15.0

func (r *TestRequest) WithCookies(cookies map[string]string) contractstesting.TestRequest

func (*TestRequest) WithHeader added in v1.15.0

func (r *TestRequest) WithHeader(key, value string) contractstesting.TestRequest

func (*TestRequest) WithHeaders added in v1.15.0

func (r *TestRequest) WithHeaders(headers map[string]string) contractstesting.TestRequest

func (*TestRequest) WithSession added in v1.15.0

func (r *TestRequest) WithSession(attributes map[string]any) contractstesting.TestRequest

func (*TestRequest) WithToken added in v1.15.0

func (r *TestRequest) WithToken(token string, ttype ...string) contractstesting.TestRequest

func (*TestRequest) WithoutHeader added in v1.15.0

func (r *TestRequest) WithoutHeader(key string) contractstesting.TestRequest

func (*TestRequest) WithoutToken added in v1.15.0

func (r *TestRequest) WithoutToken() contractstesting.TestRequest

type TestResponseImpl added in v1.15.0

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

func (*TestResponseImpl) AssertAccepted added in v1.15.0

func (r *TestResponseImpl) AssertAccepted() contractstesting.TestResponse

func (*TestResponseImpl) AssertBadRequest added in v1.15.0

func (r *TestResponseImpl) AssertBadRequest() contractstesting.TestResponse

func (*TestResponseImpl) AssertConflict added in v1.15.0

func (r *TestResponseImpl) AssertConflict() contractstesting.TestResponse

func (*TestResponseImpl) AssertCookie added in v1.15.0

func (r *TestResponseImpl) AssertCookie(name, value string) contractstesting.TestResponse

func (*TestResponseImpl) AssertCookieExpired added in v1.15.0

func (r *TestResponseImpl) AssertCookieExpired(name string) contractstesting.TestResponse

func (*TestResponseImpl) AssertCookieMissing added in v1.15.0

func (r *TestResponseImpl) AssertCookieMissing(name string) contractstesting.TestResponse

func (*TestResponseImpl) AssertCookieNotExpired added in v1.15.0

func (r *TestResponseImpl) AssertCookieNotExpired(name string) contractstesting.TestResponse

func (*TestResponseImpl) AssertCreated added in v1.15.0

func (r *TestResponseImpl) AssertCreated() contractstesting.TestResponse

func (*TestResponseImpl) AssertDontSee added in v1.15.0

func (r *TestResponseImpl) AssertDontSee(value []string, escaped ...bool) contractstesting.TestResponse

func (*TestResponseImpl) AssertExactJson added in v1.15.0

func (r *TestResponseImpl) AssertExactJson(data map[string]any) contractstesting.TestResponse

func (*TestResponseImpl) AssertFluentJson added in v1.15.0

func (r *TestResponseImpl) AssertFluentJson(callback func(json contractstesting.AssertableJSON)) contractstesting.TestResponse

func (*TestResponseImpl) AssertForbidden added in v1.15.0

func (r *TestResponseImpl) AssertForbidden() contractstesting.TestResponse

func (*TestResponseImpl) AssertFound added in v1.15.0

func (*TestResponseImpl) AssertGone added in v1.15.0

func (*TestResponseImpl) AssertHeader added in v1.15.0

func (r *TestResponseImpl) AssertHeader(headerName, value string) contractstesting.TestResponse

func (*TestResponseImpl) AssertHeaderMissing added in v1.15.0

func (r *TestResponseImpl) AssertHeaderMissing(headerName string) contractstesting.TestResponse

func (*TestResponseImpl) AssertInternalServerError added in v1.15.0

func (r *TestResponseImpl) AssertInternalServerError() contractstesting.TestResponse

func (*TestResponseImpl) AssertJson added in v1.15.0

func (r *TestResponseImpl) AssertJson(data map[string]any) contractstesting.TestResponse

func (*TestResponseImpl) AssertJsonMissing added in v1.15.0

func (r *TestResponseImpl) AssertJsonMissing(data map[string]any) contractstesting.TestResponse

func (*TestResponseImpl) AssertMethodNotAllowed added in v1.15.0

func (r *TestResponseImpl) AssertMethodNotAllowed() contractstesting.TestResponse

func (*TestResponseImpl) AssertMovedPermanently added in v1.15.0

func (r *TestResponseImpl) AssertMovedPermanently() contractstesting.TestResponse

func (*TestResponseImpl) AssertNoContent added in v1.15.0

func (r *TestResponseImpl) AssertNoContent(status ...int) contractstesting.TestResponse

func (*TestResponseImpl) AssertNotAcceptable added in v1.15.0

func (r *TestResponseImpl) AssertNotAcceptable() contractstesting.TestResponse

func (*TestResponseImpl) AssertNotFound added in v1.15.0

func (r *TestResponseImpl) AssertNotFound() contractstesting.TestResponse

func (*TestResponseImpl) AssertNotModified added in v1.15.0

func (r *TestResponseImpl) AssertNotModified() contractstesting.TestResponse

func (*TestResponseImpl) AssertOk added in v1.15.0

func (*TestResponseImpl) AssertPartialContent added in v1.15.0

func (r *TestResponseImpl) AssertPartialContent() contractstesting.TestResponse

func (*TestResponseImpl) AssertPaymentRequired added in v1.15.0

func (r *TestResponseImpl) AssertPaymentRequired() contractstesting.TestResponse

func (*TestResponseImpl) AssertRequestTimeout added in v1.15.0

func (r *TestResponseImpl) AssertRequestTimeout() contractstesting.TestResponse

func (*TestResponseImpl) AssertSee added in v1.15.0

func (r *TestResponseImpl) AssertSee(value []string, escaped ...bool) contractstesting.TestResponse

func (*TestResponseImpl) AssertSeeInOrder added in v1.15.0

func (r *TestResponseImpl) AssertSeeInOrder(value []string, escaped ...bool) contractstesting.TestResponse

func (*TestResponseImpl) AssertServerError added in v1.15.0

func (r *TestResponseImpl) AssertServerError() contractstesting.TestResponse

func (*TestResponseImpl) AssertServiceUnavailable added in v1.15.0

func (r *TestResponseImpl) AssertServiceUnavailable() contractstesting.TestResponse

func (*TestResponseImpl) AssertStatus added in v1.15.0

func (r *TestResponseImpl) AssertStatus(status int) contractstesting.TestResponse

func (*TestResponseImpl) AssertSuccessful added in v1.15.0

func (r *TestResponseImpl) AssertSuccessful() contractstesting.TestResponse

func (*TestResponseImpl) AssertTemporaryRedirect added in v1.15.0

func (r *TestResponseImpl) AssertTemporaryRedirect() contractstesting.TestResponse

func (*TestResponseImpl) AssertTooManyRequests added in v1.15.0

func (r *TestResponseImpl) AssertTooManyRequests() contractstesting.TestResponse

func (*TestResponseImpl) AssertUnauthorized added in v1.15.0

func (r *TestResponseImpl) AssertUnauthorized() contractstesting.TestResponse

func (*TestResponseImpl) AssertUnprocessableEntity added in v1.15.0

func (r *TestResponseImpl) AssertUnprocessableEntity() contractstesting.TestResponse

func (*TestResponseImpl) AssertUnsupportedMediaType added in v1.15.0

func (r *TestResponseImpl) AssertUnsupportedMediaType() contractstesting.TestResponse

func (*TestResponseImpl) Content added in v1.15.0

func (r *TestResponseImpl) Content() (string, error)

func (*TestResponseImpl) Cookie added in v1.15.0

func (r *TestResponseImpl) Cookie(name string) *http.Cookie

func (*TestResponseImpl) Cookies added in v1.15.0

func (r *TestResponseImpl) Cookies() []*http.Cookie

func (*TestResponseImpl) Headers added in v1.15.0

func (r *TestResponseImpl) Headers() http.Header

func (*TestResponseImpl) IsServerError added in v1.15.0

func (r *TestResponseImpl) IsServerError() bool

func (*TestResponseImpl) IsSuccessful added in v1.15.0

func (r *TestResponseImpl) IsSuccessful() bool

func (*TestResponseImpl) Json added in v1.15.0

func (r *TestResponseImpl) Json() (map[string]any, error)

func (*TestResponseImpl) Session added in v1.15.0

func (r *TestResponseImpl) Session() (map[string]any, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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