Commit 359dfdcc authored by Henning Leutz's avatar Henning Leutz 🥋

phpunit start

parent 469c4bc7
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="./tests/bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
syntaxCheck="false"
>
<testsuites>
<testsuite name="QUIQQER Test Suite">
<directory suffix=".php">./tests/</directory>
</testsuite>
</testsuites>
</phpunit>
\ No newline at end of file
<?php
/**
* Class GroupTest
*/
class GroupTest extends PHPUnit_Framework_TestCase
{
/**
* Create child test
* @throws \QUI\Exception
*/
public function testCreateChild()
{
$Root = QUI::getGroups()->firstChild();
// exists phpunit group?
$children = $Root->getChildren();
foreach ($children as $groupData) {
if ($groupData['name'] == 'phpunit') {
QUI::getGroups()->get($groupData['id'])->delete();
}
}
$PHPUnitGroup = $Root->createChild('phpunit');
$this->assertGreaterThan(10, $PHPUnitGroup->getId());
// test phunit group in db
// delete phpunit group
$PHPUnitGroup->delete();
}
}
\ No newline at end of file
<?php
/**
* Class GroupTest
*/
class ManagerTest extends PHPUnit_Framework_TestCase
{
public function testFirstChild()
{
$Root = QUI::getGroups()->firstChild();
$this->assertGreaterThan(10, $Root->getId());
}
}
\ No newline at end of file
<?php
$quiqqerPackageDir = dirname(dirname(__FILE__));
$packageDir = dirname(dirname($quiqqerPackageDir));
$autloaderFile = $packageDir .'/autoload.php';
$headerFile = $packageDir .'/header.php';
// autoloader
require $autloaderFile;
if (!file_exists($headerFile)) {
throw new \Exception('QUIQQER must be installed.');
}
require $headerFile;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment