CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (Github)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C Elastic Search 2.x API

  • Project:
    • Elastic Search
      • CakePHP
      • Authentication
      • Authorization
      • Chronos
      • Elastic Search
      • Queue
  • Version:
    • 2.x
      • 4.x
      • 3.x
      • 2.x

Namespaces

  • Cake\ElasticSearch
    • Association
    • Datasource
    • Rule
    • TestSuite
    • View

Class TestFixture

A Test fixture implementation for elastic search.

Lets you seed indexes for testing your application.

Class extension is temporary as fixtures are missing an interface.

Namespace: Cake\ElasticSearch\TestSuite

Property Summary

  • $connection public
    string

    The connection name to use for this fixture.

  • $created public
    array

    A list of connections this fixtures has been added to.

  • $records public
    array

    The records to insert.

  • $schema public
    array

    The Elastic search type mapping definition for this type.

  • $table public
    string

    Full Table Name

Method Summary

  • __construct() public

    Instantiate the fixture.

  • connection() public

    Get the connection name this fixture should be inserted into.

  • create() public

    Create index and mapping for the type.

  • createConstraints() public

    No-op method needed because of the Fixture interface. Elasticsearch does not deal with foreign key constraints.

  • drop() public

    Drops the index

  • dropConstraints() public

    No-op method needed because of the Fixture interface. Elasticsearch does not deal with foreign key constraints.

  • getIndex() public

    Return the index class from table name

  • init() public

    Initialize the fixture.

  • insert() public

    Insert fixture documents.

  • sourceName() public

    Get the table/collection name for this fixture.

  • truncate() public

    Truncate the fixture type.

Method Detail

__construct() ¶ public

__construct()

Instantiate the fixture.

Throws
Cake\Core\Exception\Exception
on invalid datasource usage.

connection() ¶ public

connection(): string

Get the connection name this fixture should be inserted into.

Returns
string

create() ¶ public

create(Cake\Datasource\ConnectionInterface $db): void

Create index and mapping for the type.

Parameters
Cake\Datasource\ConnectionInterface $db

The Elasticsearch connection

Returns
void

createConstraints() ¶ public

createConstraints(Cake\Datasource\ConnectionInterface $db): void

No-op method needed because of the Fixture interface. Elasticsearch does not deal with foreign key constraints.

Parameters
Cake\Datasource\ConnectionInterface $db

The Elasticsearch connection

Returns
void

drop() ¶ public

drop(Cake\Datasource\ConnectionInterface $db): void

Drops the index

Parameters
Cake\Datasource\ConnectionInterface $db

The Elasticsearch connection

Returns
void

dropConstraints() ¶ public

dropConstraints(Cake\Datasource\ConnectionInterface $db): void

No-op method needed because of the Fixture interface. Elasticsearch does not deal with foreign key constraints.

Parameters
Cake\Datasource\ConnectionInterface $db

The Elasticsearch connection connection

Returns
void

getIndex() ¶ public

getIndex(): Cake\ElasticSearch\Index

Return the index class from table name

Returns
Cake\ElasticSearch\Index

init() ¶ public

init(): void

Initialize the fixture.

Returns
void

insert() ¶ public

insert(Cake\Datasource\ConnectionInterface $db): void

Insert fixture documents.

Should insert all the records into the test database.

Parameters
Cake\Datasource\ConnectionInterface $db

The Elasticsearch connection

Returns
void

sourceName() ¶ public

sourceName(): string

Get the table/collection name for this fixture.

Returns
string

truncate() ¶ public

truncate(Cake\Datasource\ConnectionInterface $db): void

Truncate the fixture type.

Parameters
Cake\Datasource\ConnectionInterface $db

The Elasticsearch connection

Returns
void

Property Detail

$connection ¶ public

The connection name to use for this fixture.

Type
string

$created ¶ public

A list of connections this fixtures has been added to.

Type
array

$records ¶ public

The records to insert.

Type
array

$schema ¶ public

The Elastic search type mapping definition for this type.

The schema defined here should be compatible with Elasticsearch's mapping API and Elastica

Type
array

$table ¶ public

Full Table Name

Type
string
OpenHub
Pingping
Linode
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (Github)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs