dolibarr/htdocs/modulebuilder/template/test/phpunit/MyObjectTest.php

111 lines
2.2 KiB
PHP
Raw Permalink Normal View History

2017-05-08 21:00:23 +02:00
<?php
2017-07-08 15:43:36 +02:00
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) ---Put here your own copyright and developer email---
2017-05-08 21:00:23 +02:00
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
2019-09-23 21:55:30 +02:00
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2017-05-08 21:00:23 +02:00
*/
/**
2017-05-27 13:46:34 +02:00
* \file test/unit/MyObjectTest.php
2017-05-08 21:00:23 +02:00
* \ingroup mymodule
2017-05-27 13:46:34 +02:00
* \brief PHPUnit test for MyObject class.
2017-05-08 21:00:23 +02:00
*/
namespace test\unit;
/**
2017-05-27 13:46:34 +02:00
* Class MyObjectTest
2017-05-10 13:56:05 +02:00
* @package Testmymodule
2017-05-08 21:00:23 +02:00
*/
2017-05-27 13:46:34 +02:00
class MyObjectTest extends \PHPUnit_Framework_TestCase
2017-05-08 21:00:23 +02:00
{
/**
* Global test setup
* @return void
2017-05-08 21:00:23 +02:00
*/
public static function setUpBeforeClass()
{
fwrite(STDOUT, __METHOD__."\n");
2017-05-08 21:00:23 +02:00
}
/**
* Unit test setup
* @return void
2017-05-08 21:00:23 +02:00
*/
protected function setUp()
{
fwrite(STDOUT, __METHOD__."\n");
2017-05-08 21:00:23 +02:00
}
/**
* Verify pre conditions
* @return void
2017-05-08 21:00:23 +02:00
*/
protected function assertPreConditions()
{
fwrite(STDOUT, __METHOD__."\n");
2017-05-08 21:00:23 +02:00
}
/**
* A sample test
* @return bool
2017-05-08 21:00:23 +02:00
*/
public function testSomething()
{
fwrite(STDOUT, __METHOD__."\n");
2017-05-08 21:00:23 +02:00
// TODO: test something
$this->assertTrue(true);
}
/**
* Verify post conditions
* @return void
2017-05-08 21:00:23 +02:00
*/
protected function assertPostConditions()
{
fwrite(STDOUT, __METHOD__."\n");
2017-05-08 21:00:23 +02:00
}
/**
* Unit test teardown
* @return void
2017-05-08 21:00:23 +02:00
*/
protected function tearDown()
{
fwrite(STDOUT, __METHOD__."\n");
2017-05-08 21:00:23 +02:00
}
/**
* Global test teardown
* @return void
2017-05-08 21:00:23 +02:00
*/
public static function tearDownAfterClass()
{
fwrite(STDOUT, __METHOD__."\n");
2017-05-08 21:00:23 +02:00
}
/**
* Unsuccessful test
*
2017-05-10 13:56:05 +02:00
* @param Exception $e Exception
* @return void
2017-05-10 13:56:05 +02:00
* @throws Exception
2017-05-08 21:00:23 +02:00
*/
2017-05-10 13:56:05 +02:00
protected function onNotSuccessfulTest(Exception $e)
2017-05-08 21:00:23 +02:00
{
fwrite(STDOUT, __METHOD__."\n");
2017-05-08 21:00:23 +02:00
throw $e;
}
}