activitypub-php/test/ActivityPubTest.php

37 lines
905 B
PHP
Raw Normal View History

<?php
2018-11-24 03:25:56 +00:00
namespace ActivityPub\Test;
2018-11-20 11:29:09 +00:00
use ActivityPub\ActivityPub;
2018-11-24 03:25:56 +00:00
use ActivityPub\Test\Config\SQLiteTestCase;
use ActivityPub\Test\Config\ArrayDataSet;
2018-11-23 13:28:46 +00:00
class ActivityPubTest extends SQLiteTestCase
{
public function getDataSet() {
return new ArrayDataSet( array() );
}
public function testItCreatesSchema() {
2018-11-20 11:29:09 +00:00
$this->assertTrue( file_exists( $this->getDbPath() ) );
}
/**
* @depends testItCreatesSchema
*/
public function testItUpdatesSchema() {
$activityPub = new ActivityPub(array(
'dbOptions' => array(
'driver' => 'pdo_sqlite',
'path' => $this->getDbPath(),
),
) );
$activityPub->updateSchema();
$this->assertTrue( file_exists( $this->getDbPath() ) );
}
private function getDbPath() {
return dirname( __FILE__ ) . '/db.sqlite';
}
}
?>