Documentation
¶
Index ¶
- func NewAssertableJSON(t *testing.T, jsonStr string) (contractstesting.AssertableJSON, error)
- func NewTestRequest(t *testing.T) contractstesting.TestRequest
- func NewTestResponse(t *testing.T, response *http.Response) contractstesting.TestResponse
- type Application
- type AssertableJson
- func (r *AssertableJson) Count(key string, length int) contractstesting.AssertableJSON
- func (r *AssertableJson) Each(key string, callback func(contractstesting.AssertableJSON)) contractstesting.AssertableJSON
- func (r *AssertableJson) First(key string, callback func(contractstesting.AssertableJSON)) contractstesting.AssertableJSON
- func (r *AssertableJson) Has(key string) contractstesting.AssertableJSON
- func (r *AssertableJson) HasAll(keys []string) contractstesting.AssertableJSON
- func (r *AssertableJson) HasAny(keys []string) contractstesting.AssertableJSON
- func (r *AssertableJson) HasWithScope(key string, length int, callback func(contractstesting.AssertableJSON)) contractstesting.AssertableJSON
- func (r *AssertableJson) Json() map[string]any
- func (r *AssertableJson) Missing(key string) contractstesting.AssertableJSON
- func (r *AssertableJson) MissingAll(keys []string) contractstesting.AssertableJSON
- func (r *AssertableJson) Where(key string, value any) contractstesting.AssertableJSON
- func (r *AssertableJson) WhereNot(key string, value any) contractstesting.AssertableJSON
- type ServiceProvider
- type TestCase
- type TestRequest
- func (r *TestRequest) Bind(value any) contractstesting.TestRequest
- func (r *TestRequest) Delete(uri string, body io.Reader) (contractstesting.TestResponse, error)
- func (r *TestRequest) FlushHeaders() contractstesting.TestRequest
- func (r *TestRequest) Get(uri string) (contractstesting.TestResponse, error)
- func (r *TestRequest) Head(uri string) (contractstesting.TestResponse, error)
- func (r *TestRequest) Options(uri string) (contractstesting.TestResponse, error)
- func (r *TestRequest) Patch(uri string, body io.Reader) (contractstesting.TestResponse, error)
- func (r *TestRequest) Post(uri string, body io.Reader) (contractstesting.TestResponse, error)
- func (r *TestRequest) Put(uri string, body io.Reader) (contractstesting.TestResponse, error)
- func (r *TestRequest) WithBasicAuth(username, password string) contractstesting.TestRequest
- func (r *TestRequest) WithContext(ctx context.Context) contractstesting.TestRequest
- func (r *TestRequest) WithCookie(key, value string) contractstesting.TestRequest
- func (r *TestRequest) WithCookies(cookies map[string]string) contractstesting.TestRequest
- func (r *TestRequest) WithHeader(key, value string) contractstesting.TestRequest
- func (r *TestRequest) WithHeaders(headers map[string]string) contractstesting.TestRequest
- func (r *TestRequest) WithSession(attributes map[string]any) contractstesting.TestRequest
- func (r *TestRequest) WithToken(token string, ttype ...string) contractstesting.TestRequest
- func (r *TestRequest) WithoutHeader(key string) contractstesting.TestRequest
- func (r *TestRequest) WithoutToken() contractstesting.TestRequest
- type TestResponseImpl
- func (r *TestResponseImpl) AssertAccepted() contractstesting.TestResponse
- func (r *TestResponseImpl) AssertBadRequest() contractstesting.TestResponse
- func (r *TestResponseImpl) AssertConflict() contractstesting.TestResponse
- func (r *TestResponseImpl) AssertCookie(name, value string) contractstesting.TestResponse
- func (r *TestResponseImpl) AssertCookieExpired(name string) contractstesting.TestResponse
- func (r *TestResponseImpl) AssertCookieMissing(name string) contractstesting.TestResponse
- func (r *TestResponseImpl) AssertCookieNotExpired(name string) contractstesting.TestResponse
- func (r *TestResponseImpl) AssertCreated() contractstesting.TestResponse
- func (r *TestResponseImpl) AssertDontSee(value []string, escaped ...bool) contractstesting.TestResponse
- func (r *TestResponseImpl) AssertExactJson(data map[string]any) contractstesting.TestResponse
- func (r *TestResponseImpl) AssertFluentJson(callback func(json contractstesting.AssertableJSON)) contractstesting.TestResponse
- func (r *TestResponseImpl) AssertForbidden() contractstesting.TestResponse
- func (r *TestResponseImpl) AssertFound() contractstesting.TestResponse
- func (r *TestResponseImpl) AssertGone() contractstesting.TestResponse
- func (r *TestResponseImpl) AssertHeader(headerName, value string) contractstesting.TestResponse
- func (r *TestResponseImpl) AssertHeaderMissing(headerName string) contractstesting.TestResponse
- func (r *TestResponseImpl) AssertInternalServerError() contractstesting.TestResponse
- func (r *TestResponseImpl) AssertJson(data map[string]any) contractstesting.TestResponse
- func (r *TestResponseImpl) AssertJsonMissing(data map[string]any) contractstesting.TestResponse
- func (r *TestResponseImpl) AssertMethodNotAllowed() contractstesting.TestResponse
- func (r *TestResponseImpl) AssertMovedPermanently() contractstesting.TestResponse
- func (r *TestResponseImpl) AssertNoContent(status ...int) contractstesting.TestResponse
- func (r *TestResponseImpl) AssertNotAcceptable() contractstesting.TestResponse
- func (r *TestResponseImpl) AssertNotFound() contractstesting.TestResponse
- func (r *TestResponseImpl) AssertNotModified() contractstesting.TestResponse
- func (r *TestResponseImpl) AssertOk() contractstesting.TestResponse
- func (r *TestResponseImpl) AssertPartialContent() contractstesting.TestResponse
- func (r *TestResponseImpl) AssertPaymentRequired() contractstesting.TestResponse
- func (r *TestResponseImpl) AssertRequestTimeout() contractstesting.TestResponse
- func (r *TestResponseImpl) AssertSee(value []string, escaped ...bool) contractstesting.TestResponse
- func (r *TestResponseImpl) AssertSeeInOrder(value []string, escaped ...bool) contractstesting.TestResponse
- func (r *TestResponseImpl) AssertServerError() contractstesting.TestResponse
- func (r *TestResponseImpl) AssertServiceUnavailable() contractstesting.TestResponse
- func (r *TestResponseImpl) AssertStatus(status int) contractstesting.TestResponse
- func (r *TestResponseImpl) AssertSuccessful() contractstesting.TestResponse
- func (r *TestResponseImpl) AssertTemporaryRedirect() contractstesting.TestResponse
- func (r *TestResponseImpl) AssertTooManyRequests() contractstesting.TestResponse
- func (r *TestResponseImpl) AssertUnauthorized() contractstesting.TestResponse
- func (r *TestResponseImpl) AssertUnprocessableEntity() contractstesting.TestResponse
- func (r *TestResponseImpl) AssertUnsupportedMediaType() contractstesting.TestResponse
- func (r *TestResponseImpl) Content() (string, error)
- func (r *TestResponseImpl) Cookie(name string) *http.Cookie
- func (r *TestResponseImpl) Cookies() []*http.Cookie
- func (r *TestResponseImpl) Headers() http.Header
- func (r *TestResponseImpl) IsServerError() bool
- func (r *TestResponseImpl) IsSuccessful() bool
- func (r *TestResponseImpl) Json() (map[string]any, error)
- func (r *TestResponseImpl) Session() (map[string]any, error)
Constants ¶
This section is empty.
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 (r *AssertableJson) Count(key string, length int) contractstesting.AssertableJSON
func (*AssertableJson) Each ¶ added in v1.15.0
func (r *AssertableJson) Each(key string, callback func(contractstesting.AssertableJSON)) contractstesting.AssertableJSON
func (*AssertableJson) First ¶ added in v1.15.0
func (r *AssertableJson) First(key string, callback func(contractstesting.AssertableJSON)) contractstesting.AssertableJSON
func (*AssertableJson) Has ¶ added in v1.15.0
func (r *AssertableJson) Has(key string) contractstesting.AssertableJSON
func (*AssertableJson) HasAll ¶ added in v1.15.0
func (r *AssertableJson) HasAll(keys []string) contractstesting.AssertableJSON
func (*AssertableJson) HasAny ¶ added in v1.15.0
func (r *AssertableJson) HasAny(keys []string) contractstesting.AssertableJSON
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 (r *AssertableJson) Missing(key string) contractstesting.AssertableJSON
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 (r *AssertableJson) Where(key string, value any) contractstesting.AssertableJSON
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 (testing *ServiceProvider) Boot(app foundation.Application)
func (*ServiceProvider) Register ¶ added in v1.13.0
func (testing *ServiceProvider) Register(app foundation.Application)
type TestCase ¶ added in v1.13.0
type TestCase struct {
}
func (*TestCase) Http ¶ added in v1.15.0
func (r *TestCase) Http(t *testing.T) contractstesting.TestRequest
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 (r *TestRequest) Bind(value any) contractstesting.TestRequest
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 (r *TestRequest) Get(uri string) (contractstesting.TestResponse, error)
func (*TestRequest) Head ¶ added in v1.15.0
func (r *TestRequest) Head(uri string) (contractstesting.TestResponse, error)
func (*TestRequest) Options ¶ added in v1.15.0
func (r *TestRequest) Options(uri string) (contractstesting.TestResponse, error)
func (*TestRequest) Patch ¶ added in v1.15.0
func (r *TestRequest) Patch(uri string, body io.Reader) (contractstesting.TestResponse, error)
func (*TestRequest) Post ¶ added in v1.15.0
func (r *TestRequest) Post(uri string, body io.Reader) (contractstesting.TestResponse, error)
func (*TestRequest) Put ¶ added in v1.15.0
func (r *TestRequest) Put(uri string, body io.Reader) (contractstesting.TestResponse, error)
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 (r *TestRequest) WithContext(ctx context.Context) contractstesting.TestRequest
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 (r *TestResponseImpl) AssertFound() contractstesting.TestResponse
func (*TestResponseImpl) AssertGone ¶ added in v1.15.0
func (r *TestResponseImpl) AssertGone() contractstesting.TestResponse
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 (r *TestResponseImpl) AssertOk() contractstesting.TestResponse
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
Source Files
¶
Click to show internal directories.
Click to hide internal directories.