PHP Class RedUNIT\Base\Finding

Tests whether we can find beans by passing SQL queries to the Facade or the Finder Service Class.
Author: Gabor de Mooij and the RedBeanPHP Community
Inheritance: extends RedUNIT\Base
Show file Open project: gabordemooij/redbean

Public Methods

Method Description
testFindAndExport ( ) : void Test find and export.
testFindError ( ) : void Test error handling of SQL states.
testFindLike ( ) : void Tests the findLike method.
testFindLike2 ( ) : void Test findLike.
testFindMulti ( ) : void Test findMulti(). Basic version.
testFindMultiDIY ( ) : void Test findMulti() with manual crafted fields.
testFindMultiDirectArray ( ) : void Test findMuli with self-made arrays.
testFindMultiErrorHandling ( ) : void FindMulti should not throw errors in case of a record-type mismatch.
testFindMultiExtFunc ( ) : void You can build your own mapping functions to remap records to bean.
testFindOneLimitOne ( ) : void Test whether findOne gets a LIMIT 1 clause.
testFindOrCreate ( ) : void Tests the findOrCreate method.
testFinding ( ) : void Begin testing.
testINClause ( ) : void Test forming IN-clause using genSlots and flat.
testMultiAdvanced ( ) : void Tests the complex use case for findMulti().
testTreeTraversal ( ) : void Test tree traversal with searchIn().

Private Methods

Method Description
getColors ( array $flowers, boolean $noSort = FALSE ) : string Helper for testing findLike.
insertBookData ( ) : void Inserts data for findMulti-tests.
map ( string $parentName, string $childName ) : array A custom record-to-bean mapping function for findMulti test.

Method Details

testFindAndExport() public method

Test find and export.
public testFindAndExport ( ) : void
return void

testFindError() public method

Test error handling of SQL states.
public testFindError ( ) : void
return void

testFindLike() public method

Tests the findLike method.
public testFindLike ( ) : void
return void

testFindLike2() public method

Test findLike.
public testFindLike2 ( ) : void
return void

testFindMulti() public method

Test findMulti(). Basic version.
public testFindMulti ( ) : void
return void

testFindMultiDIY() public method

Test findMulti() with manual crafted fields.
public testFindMultiDIY ( ) : void
return void

testFindMultiDirectArray() public method

Test findMuli with self-made arrays.
public testFindMultiDirectArray ( ) : void
return void

testFindMultiErrorHandling() public method

FindMulti should not throw errors in case of a record-type mismatch.
public testFindMultiErrorHandling ( ) : void
return void

testFindMultiExtFunc() public method

Just like the preloader once did. However now you can define the mapping yourself using closures. This test verifies that such a function would actually work. This method also tests whether empty records (resulting from LEFT JOINS for instance) do not produce unnecessary, empty beans.
public testFindMultiExtFunc ( ) : void
return void

testFindOneLimitOne() public method

Test whether findOne gets a LIMIT 1 clause.
public testFindOneLimitOne ( ) : void
return void

testFindOrCreate() public method

Tests the findOrCreate method.
public testFindOrCreate ( ) : void
return void

testFinding() public method

This method runs the actual test pack.
public testFinding ( ) : void
return void

testINClause() public method

Test forming IN-clause using genSlots and flat.
public testINClause ( ) : void
return void

testMultiAdvanced() public method

Tests the complex use case for findMulti().
public testMultiAdvanced ( ) : void
return void

testTreeTraversal() public method

Test tree traversal with searchIn().
public testTreeTraversal ( ) : void
return void