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 CakePHP 3.3 Red Velvet API

  • Project:
    • CakePHP
      • CakePHP
      • Authentication
      • Authorization
      • Chronos
      • Elastic Search
      • Queue
  • Version:
    • 3.3
      • 5.2
      • 5.1
      • 5.0
      • 4.6
      • 4.5
      • 4.4
      • 4.3
      • 4.2
      • 4.1
      • 4.0
      • 3.10
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Namespaces

  • Global
  • Cake
    • Auth
    • Cache
    • Collection
    • Console
    • Controller
    • Core
    • Database
    • Datasource
      • Exception
    • Error
    • Event
    • Filesystem
    • Form
    • Http
    • I18n
    • Log
    • Mailer
    • Network
    • ORM
    • Routing
    • Shell
    • TestSuite
    • Utility
    • Validation
    • View

Interface FixtureInterface

Defines the interface that testing fixtures use.

Namespace: Cake\Datasource

Method Summary

  • connection() public

    Get the connection name this fixture should be inserted into.

  • create() public

    Create the fixture schema/mapping/definition

  • createConstraints() public

    Build and execute SQL queries necessary to create the constraints for the fixture

  • drop() public

    Run after all tests executed, should remove the table/collection from the connection.

  • dropConstraints() public

    Build and execute SQL queries necessary to drop the constraints for the fixture

  • insert() public

    Run before each test is executed.

  • sourceName() public

    Get the table/collection name for this fixture.

  • truncate() public

    Truncates the current fixture.

Method Detail

connection() ¶ public

connection(): string

Get the connection name this fixture should be inserted into.

Returns
string

create() ¶ public

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

Create the fixture schema/mapping/definition

Parameters
Cake\Datasource\ConnectionInterface $db

An instance of the connection the fixture should be created on.

Returns
bool

createConstraints() ¶ public

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

Build and execute SQL queries necessary to create the constraints for the fixture

Parameters
Cake\Datasource\ConnectionInterface $db

An instance of the database into which the constraints will be created

Returns
bool

drop() ¶ public

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

Run after all tests executed, should remove the table/collection from the connection.

Parameters
Cake\Datasource\ConnectionInterface $db

An instance of the connection the fixture should be removed from.

Returns
bool

dropConstraints() ¶ public

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

Build and execute SQL queries necessary to drop the constraints for the fixture

Parameters
Cake\Datasource\ConnectionInterface $db

An instance of the database into which the constraints will be dropped

Returns
bool

insert() ¶ public

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

Run before each test is executed.

Should insert all the records into the test database.

Parameters
Cake\Datasource\ConnectionInterface $db

An instance of the connection into which the records will be inserted.

Returns
bool

sourceName() ¶ public

sourceName(): string

Get the table/collection name for this fixture.

Returns
string

truncate() ¶ public

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

Truncates the current fixture.

Parameters
Cake\Datasource\ConnectionInterface $db

A reference to a db instance

Returns
bool
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