PersistenceObjects for php

2. Create a test

Not really necessary but quite handy when attempting to create a new project from nothing. The test we're about to create tells us if the configuration is acceptable. The test looks like this:

<pre>
require_once "persistenceobjects/UserPersistence.php";
require_once "persistenceobjects/PicturePersistence.php";
require_once "persistenceobjects/AlbumPersistence.php";

$userPersistence = new UserPersistence();
$userPersistence->validateTableAndDescriptorSetup();
$albumPersistence = new AlbumPersistence();
$albumPersistence->validateTableAndDescriptorSetup();
$picturePersistence = new PicturePersistence();
$picturePersistence->validateTableAndDescriptorSetup();
</pre>

Now if you run the file in a browser it announces errors, because we haven't got the necessary files yet. Let's see to that.


previous - Create the model classes
next - Create the PersistenceObjects