DNADesign\Populate\Tests\PopulateFactoryTest
Synopsis
class PopulateFactoryTest
extends SapphireTest
implements
TestOnly
{
- // members
- private PopulateFactory $factory;
- protected static string $fixture_file = "PopulateFactoryTest.yml";
- protected boolean $usesDatabase = true;
- protected static array $extra_dataobjects = ;
- // methods
- public void setUp()
- public void testVersionedObjects()
- public void testCreateObjectPhpEval()
- public void testCreateObjectPopulateMergeWhen()
- public void testCreateObjectPopulateMergeMatch()
- public void testMultipleMatchesRemoved()
Hierarchy
Extends
- SilverStripe\Dev\SapphireTest
Implements
- SilverStripe\Dev\TestOnly
Members
private
- $factory — DNADesign\Populate\PopulateFactory
protected
- $extra_dataobjects
- $fixture_file
- $usesDatabase
Methods
public
- setUp()
- testCreateObjectPhpEval() — As a utility you can include code to be evaluated the the yaml using Field: `something::foo()`;
- testCreateObjectPopulateMergeMatch() — When populatemergematch is provided then the matching should be done on the given fields
- testCreateObjectPopulateMergeWhen() — When a populatemergewhen clause is supplied, make sure it merges. If no record found, one should be created
- testMultipleMatchesRemoved() — When a lookup matches more than one page, only the first one should be removed.
- testVersionedObjects() — Test version support. If an object has versioned then both the live and staging tables should be updated. Other live records should be removed as well.