BEdita API doc | 4-cactus
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Download

Namespaces

  • BEdita
    • API
      • Auth
      • Controller
        • Admin
        • Component
        • Model
      • Error
      • Event
      • Exception
      • Middleware
      • Model
        • Action
      • Network
        • Exception
      • Shell
      • TestSuite
      • Utility
    • Core
      • Configure
        • Engine
      • Database
        • Type
      • Exception
      • Filesystem
        • Adapter
        • Exception
        • Thumbnail
      • I18n
      • Job
        • Service
      • Mailer
        • Preview
        • Transport
      • Model
        • Action
        • Behavior
        • Entity
        • Table
        • Validation
      • ORM
        • Inheritance
        • Locator
        • Rule
      • Shell
        • Task
      • State
      • TestSuite
        • Fixture
      • Utility

Classes

  • IntegrationTestCase

Class IntegrationTestCase

Base class for API integration tests.

Cake\TestSuite\IntegrationTestCase
Extended by BEdita\API\TestSuite\IntegrationTestCase
Abstract
Namespace: BEdita\API\TestSuite
Since: 4.0.0
Located at API/src/TestSuite/IntegrationTestCase.php

Methods summary

public
# __construct( $name = null, array $data = [], $dataName = '' )
public
# setUp( )
public
# tearDown( )
protected
# addAuthFixtures( )

Add fixtures required for authentication

Add fixtures required for authentication

public array
# getUserAuthHeader( string $username = null, string $password = null )

Return the Authorization header starting from a username and a password.

Return the Authorization header starting from a username and a password.

Parameters

$username
The user username
$password
The user password

Returns

array
protected
# _makeDispatcher( )

Codecoverageignore

public array
# authUser( string $username = null, string $password = null )

Authenticate an user and return the JWT access and renewal tokens obtained.

Authenticate an user and return the JWT access and renewal tokens obtained.

This method is also useful to set user in LoggedUser singleton.

It calls POST /auth to receive a valid jwt access token. If $username and $password are empty then a default user is used. To avoid conflicts with another request potentially prepared, for example calling self::configRequest(), the current request conf is saved and restored at the end of the /auth call.

Parameters

$username
The user username
$password
The user password

Returns

array
public
# configRequestHeaders( string $method = 'GET', array $options = [] )

Setup request headers.

Setup request headers.

Defaults: 'Host' => 'api.example.com', 'Accept' => 'application/vnd.api+json', 'Content-Type' => 'application/vnd.api+json' (POST, PATCH, DELETE methods)

Parameters

$method
HTTP method
$options
Header content options
public integer
# lastObjectId( )

Return last Object ID

Return last Object ID

Returns

integer

Codecoverageignore

Properties summary

public array $fixtures

Fixtures

Fixtures

# []
protected array $authFixtures

The required fixtures for authentication. They are added to fixtures present in test case class

The required fixtures for authentication. They are added to fixtures present in test case class

# [ 'plugin.BEdita/Core.Config', 'plugin.BEdita/Core.AsyncJobs', 'plugin.BEdita/Core.AuthProviders', 'plugin.BEdita/Core.ExternalAuth', 'plugin.BEdita/Core.ObjectTypes', 'plugin.BEdita/Core.Objects', 'plugin.BEdita/Core.Locations', 'plugin.BEdita/Core.Media', 'plugin.BEdita/Core.Profiles', 'plugin.BEdita/Core.Users', 'plugin.BEdita/Core.Roles', 'plugin.BEdita/Core.RolesUsers', 'plugin.BEdita/Core.Endpoints', 'plugin.BEdita/Core.Applications', 'plugin.BEdita/Core.EndpointPermissions', 'plugin.BEdita/Core.Relations', 'plugin.BEdita/Core.RelationTypes', 'plugin.BEdita/Core.Properties', 'plugin.BEdita/Core.PropertyTypes', 'plugin.BEdita/Core.Trees', 'plugin.BEdita/Core.ObjectRelations', 'plugin.BEdita/Core.Translations', 'plugin.BEdita/Core.UserTokens', 'plugin.BEdita/Core.Categories', 'plugin.BEdita/Core.ObjectCategories', 'plugin.BEdita/Core.History', ]
protected array $defaultUser

Default user used for authentication

Default user used for authentication

# [ 'username' => 'first user', 'password' => 'password1' ]
BEdita API doc | 4-cactus API documentation generated by ApiGen