platform/api/laravel/Foundation/Testing/Concerns/InteractsWithDatabase.yaml

302 lines
6.7 KiB
YAML
Raw Normal View History

2024-09-02 17:44:11 +00:00
name: InteractsWithDatabase
class_comment: null
dependencies:
- name: Jsonable
type: class
source: Illuminate\Contracts\Support\Jsonable
- name: Model
type: class
source: Illuminate\Database\Eloquent\Model
- name: SoftDeletes
type: class
source: Illuminate\Database\Eloquent\SoftDeletes
- name: QueryExecuted
type: class
source: Illuminate\Database\Events\QueryExecuted
- name: Arr
type: class
source: Illuminate\Support\Arr
- name: DB
type: class
source: Illuminate\Support\Facades\DB
- name: CountInDatabase
type: class
source: Illuminate\Testing\Constraints\CountInDatabase
- name: HasInDatabase
type: class
source: Illuminate\Testing\Constraints\HasInDatabase
- name: NotSoftDeletedInDatabase
type: class
source: Illuminate\Testing\Constraints\NotSoftDeletedInDatabase
- name: SoftDeletedInDatabase
type: class
source: Illuminate\Testing\Constraints\SoftDeletedInDatabase
- name: ReverseConstraint
type: class
source: PHPUnit\Framework\Constraint\LogicalNot
properties: []
methods:
- name: assertDatabaseHas
visibility: protected
parameters:
- name: table
- name: data
- name: connection
default: 'null'
comment: '# * Assert that a given where condition exists in the database.
# *
# * @param \Illuminate\Database\Eloquent\Model|string $table
# * @param array $data
# * @param string|null $connection
# * @return $this'
- name: assertDatabaseMissing
visibility: protected
parameters:
- name: table
- name: data
- name: connection
default: 'null'
comment: '# * Assert that a given where condition does not exist in the database.
# *
# * @param \Illuminate\Database\Eloquent\Model|string $table
# * @param array $data
# * @param string|null $connection
# * @return $this'
- name: assertDatabaseCount
visibility: protected
parameters:
- name: table
- name: count
- name: connection
default: 'null'
comment: '# * Assert the count of table entries.
# *
# * @param \Illuminate\Database\Eloquent\Model|string $table
# * @param int $count
# * @param string|null $connection
# * @return $this'
- name: assertDatabaseEmpty
visibility: protected
parameters:
- name: table
- name: connection
default: 'null'
comment: '# * Assert that the given table has no entries.
# *
# * @param \Illuminate\Database\Eloquent\Model|string $table
# * @param string|null $connection
# * @return $this'
- name: assertSoftDeleted
visibility: protected
parameters:
- name: table
- name: data
default: '[]'
- name: connection
default: 'null'
- name: deletedAtColumn
default: '''deleted_at'''
comment: '# * Assert the given record has been "soft deleted".
# *
# * @param \Illuminate\Database\Eloquent\Model|string $table
# * @param array $data
# * @param string|null $connection
# * @param string|null $deletedAtColumn
# * @return $this'
- name: assertNotSoftDeleted
visibility: protected
parameters:
- name: table
- name: data
default: '[]'
- name: connection
default: 'null'
- name: deletedAtColumn
default: '''deleted_at'''
comment: '# * Assert the given record has not been "soft deleted".
# *
# * @param \Illuminate\Database\Eloquent\Model|string $table
# * @param array $data
# * @param string|null $connection
# * @param string|null $deletedAtColumn
# * @return $this'
- name: assertModelExists
visibility: protected
parameters:
- name: model
comment: '# * Assert the given model exists in the database.
# *
# * @param \Illuminate\Database\Eloquent\Model $model
# * @return $this'
- name: assertModelMissing
visibility: protected
parameters:
- name: model
comment: '# * Assert the given model does not exist in the database.
# *
# * @param \Illuminate\Database\Eloquent\Model $model
# * @return $this'
- name: expectsDatabaseQueryCount
visibility: public
parameters:
- name: expected
- name: connection
default: 'null'
comment: '# * Specify the number of database queries that should occur throughout
the test.
# *
# * @param int $expected
# * @param string|null $connection
# * @return $this'
- name: isSoftDeletableModel
visibility: protected
parameters:
- name: model
comment: '# * Determine if the argument is a soft deletable model.
# *
# * @param mixed $model
# * @return bool'
- name: castAsJson
visibility: public
parameters:
- name: value
comment: '# * Cast a JSON string to a database compatible type.
# *
# * @param array|object|string $value
# * @return \Illuminate\Contracts\Database\Query\Expression'
- name: getConnection
visibility: protected
parameters:
- name: connection
default: 'null'
- name: table
default: 'null'
comment: '# * Get the database connection.
# *
# * @param string|null $connection
# * @param string|null $table
# * @return \Illuminate\Database\Connection'
- name: getTable
visibility: protected
parameters:
- name: table
comment: '# * Get the table name from the given model or string.
# *
# * @param \Illuminate\Database\Eloquent\Model|string $table
# * @return string'
- name: getTableConnection
visibility: protected
parameters:
- name: table
comment: '# * Get the table connection specified in the given model.
# *
# * @param \Illuminate\Database\Eloquent\Model|string $table
# * @return string|null'
- name: getDeletedAtColumn
visibility: protected
parameters:
- name: table
- name: defaultColumnName
default: '''deleted_at'''
comment: '# * Get the table column name used for soft deletes.
# *
# * @param string $table
# * @param string $defaultColumnName
# * @return string'
- name: newModelFor
visibility: protected
parameters:
- name: table
comment: '# * Get the model entity from the given model or string.
# *
# * @param \Illuminate\Database\Eloquent\Model|string $table
# * @return \Illuminate\Database\Eloquent\Model|null'
- name: seed
visibility: public
parameters:
- name: class
default: '''Database\\Seeders\\DatabaseSeeder'''
comment: '# * Seed a given database connection.
# *
# * @param array|string $class
# * @return $this'
traits:
- Illuminate\Contracts\Support\Jsonable
- Illuminate\Database\Eloquent\Model
- Illuminate\Database\Eloquent\SoftDeletes
- Illuminate\Database\Events\QueryExecuted
- Illuminate\Support\Arr
- Illuminate\Support\Facades\DB
- Illuminate\Testing\Constraints\CountInDatabase
- Illuminate\Testing\Constraints\HasInDatabase
- Illuminate\Testing\Constraints\NotSoftDeletedInDatabase
- Illuminate\Testing\Constraints\SoftDeletedInDatabase
interfaces: []