PHP Class SoftDelete\Test\TestCase\Model\Table\SoftDeleteBehaviorTest

Inheritance: extends Cake\TestSuite\TestCase
Show file Open project: pgbi/cakephp3-soft-delete

Public Properties

Property Type Description
$fixtures array fixtures

Public Methods

Method Description
setUp ( ) : void setUp method
tearDown ( ) : void tearDown method
testCounterCache ( ) Tests that soft deleting affects counters the same way that hard deleting.
testDelete ( ) Tests that Table::delete() does not hard delete.
testDeleteAll ( ) Tests that Table::deleteAll() does not hard delete
testDeleteWithCustomField ( ) : void Ensure that when deleting a record which has a custom field defined in the table, that it is still soft deleted.
testDynamicFinder ( ) Tests that a soft deleted entities is not found when calling Table::findByXXX()
testFind ( ) Tests that a soft deleted entities is not found when calling Table::find()
testFindBelongsToMany ( ) Tests that soft deleted records in join table are taken into account when retrieving an entity with a belongsToManyAssociation.
testFindMatching ( ) Test that entities matching a soft deleted associated record are not returned when using $query->matching().
testFindWithOrWhere ( )
testFindingWithCustomField ( ) : void Using a table with a custom soft delete field, ensure we can still filter the found results properly.
testHardDelete ( )
testHardDeleteAll ( ) Tests hardDeleteAll.
testHardDeleteWithCustomField ( ) : void With a custom soft delete field ensure that a soft deleted record can still be permanently removed.
testHasManyAssociation ( ) Tests that soft deleting an entity also soft deletes its belonging entities.
testMissingColumn ( ) When a configured field is missing from the table, an exception should be thrown
testRestore ( ) : void Test soft deleting and restoring a record.

Method Details

setUp() public method

setUp method
public setUp ( ) : void
return void

tearDown() public method

tearDown method
public tearDown ( ) : void
return void

testCounterCache() public method

Tests that soft deleting affects counters the same way that hard deleting.
public testCounterCache ( )

testDelete() public method

Tests that Table::delete() does not hard delete.
public testDelete ( )

testDeleteAll() public method

Tests that Table::deleteAll() does not hard delete
public testDeleteAll ( )

testDeleteWithCustomField() public method

Ensure that when deleting a record which has a custom field defined in the table, that it is still soft deleted.
public testDeleteWithCustomField ( ) : void
return void

testDynamicFinder() public method

Tests that a soft deleted entities is not found when calling Table::findByXXX()
public testDynamicFinder ( )

testFind() public method

Tests that a soft deleted entities is not found when calling Table::find()
public testFind ( )

testFindBelongsToMany() public method

Tests that soft deleted records in join table are taken into account when retrieving an entity with a belongsToManyAssociation.

testFindMatching() public method

Test that entities matching a soft deleted associated record are not returned when using $query->matching().
public testFindMatching ( )

testFindWithOrWhere() public method

public testFindWithOrWhere ( )

testFindingWithCustomField() public method

Using a table with a custom soft delete field, ensure we can still filter the found results properly.
public testFindingWithCustomField ( ) : void
return void

testHardDelete() public method

public testHardDelete ( )

testHardDeleteAll() public method

Tests hardDeleteAll.
public testHardDeleteAll ( )

testHardDeleteWithCustomField() public method

With a custom soft delete field ensure that a soft deleted record can still be permanently removed.

testHasManyAssociation() public method

Tests that soft deleting an entity also soft deletes its belonging entities.

testMissingColumn() public method

When a configured field is missing from the table, an exception should be thrown
public testMissingColumn ( )

testRestore() public method

Test soft deleting and restoring a record.
public testRestore ( ) : void
return void

Property Details

$fixtures public property

fixtures
public array $fixtures
return array