Added some very basic model tests
This commit is contained in:
31
tests/Models/ComponentGroupTest.php
Normal file
31
tests/Models/ComponentGroupTest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Tests\Cachet\Models;
|
||||
|
||||
use AltThree\TestBench\ValidationTrait;
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
/**
|
||||
* This is the component group model test class.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
*/
|
||||
class ComponentGroupTest extends AbstractTestCase
|
||||
{
|
||||
use ValidationTrait;
|
||||
|
||||
public function testValidation()
|
||||
{
|
||||
$this->checkRules(new ComponentGroup());
|
||||
}
|
||||
}
|
||||
31
tests/Models/ComponentTest.php
Normal file
31
tests/Models/ComponentTest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Tests\Cachet\Models;
|
||||
|
||||
use AltThree\TestBench\ValidationTrait;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
/**
|
||||
* This is the component model test class.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
*/
|
||||
class ComponentTest extends AbstractTestCase
|
||||
{
|
||||
use ValidationTrait;
|
||||
|
||||
public function testValidation()
|
||||
{
|
||||
$this->checkRules(new Component());
|
||||
}
|
||||
}
|
||||
31
tests/Models/IncidentTemplateTest.php
Normal file
31
tests/Models/IncidentTemplateTest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Tests\Cachet\Models;
|
||||
|
||||
use AltThree\TestBench\ValidationTrait;
|
||||
use CachetHQ\Cachet\Models\IncidentTemplate;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
/**
|
||||
* This is the incident template model test class.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
*/
|
||||
class IncidentTemplateTest extends AbstractTestCase
|
||||
{
|
||||
use ValidationTrait;
|
||||
|
||||
public function testValidation()
|
||||
{
|
||||
$this->checkRules(new IncidentTemplate());
|
||||
}
|
||||
}
|
||||
31
tests/Models/IncidentTest.php
Normal file
31
tests/Models/IncidentTest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Tests\Cachet\Models;
|
||||
|
||||
use AltThree\TestBench\ValidationTrait;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
/**
|
||||
* This is the incident model test class.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
*/
|
||||
class IncidentTest extends AbstractTestCase
|
||||
{
|
||||
use ValidationTrait;
|
||||
|
||||
public function testValidation()
|
||||
{
|
||||
$this->checkRules(new Incident());
|
||||
}
|
||||
}
|
||||
28
tests/Models/InviteTest.php
Normal file
28
tests/Models/InviteTest.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Tests\Cachet\Models;
|
||||
|
||||
use CachetHQ\Cachet\Models\Invite;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
/**
|
||||
* This is the invite model test class.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
*/
|
||||
class InviteTest extends AbstractTestCase
|
||||
{
|
||||
public function testValidation()
|
||||
{
|
||||
$this->assertFalse(property_exists(new Invite(), 'rules'));
|
||||
}
|
||||
}
|
||||
31
tests/Models/MetricPointTest.php
Normal file
31
tests/Models/MetricPointTest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Tests\Cachet\Models;
|
||||
|
||||
use AltThree\TestBench\ValidationTrait;
|
||||
use CachetHQ\Cachet\Models\MetricPoint;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
/**
|
||||
* This is the metric point model test class.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
*/
|
||||
class MetricPointTest extends AbstractTestCase
|
||||
{
|
||||
use ValidationTrait;
|
||||
|
||||
public function testValidation()
|
||||
{
|
||||
$this->checkRules(new MetricPoint());
|
||||
}
|
||||
}
|
||||
31
tests/Models/MetricTest.php
Normal file
31
tests/Models/MetricTest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Tests\Cachet\Models;
|
||||
|
||||
use AltThree\TestBench\ValidationTrait;
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
/**
|
||||
* This is the metric model test class.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
*/
|
||||
class MetricTest extends AbstractTestCase
|
||||
{
|
||||
use ValidationTrait;
|
||||
|
||||
public function testValidation()
|
||||
{
|
||||
$this->checkRules(new Metric());
|
||||
}
|
||||
}
|
||||
30
tests/Models/ModelExistenceTest.php
Normal file
30
tests/Models/ModelExistenceTest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Tests\Cachet\Models;
|
||||
|
||||
use AltThree\TestBench\ExistenceTrait;
|
||||
use PHPUnit_Framework_TestCase as TestCase;
|
||||
|
||||
/**
|
||||
* This is the model existence test class.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
*/
|
||||
class ModelExistenceTest extends TestCase
|
||||
{
|
||||
use ExistenceTrait;
|
||||
|
||||
protected function getSourcePath()
|
||||
{
|
||||
return realpath(__DIR__.'/../../app/Models');
|
||||
}
|
||||
}
|
||||
28
tests/Models/SettingTest.php
Normal file
28
tests/Models/SettingTest.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Tests\Cachet\Models;
|
||||
|
||||
use CachetHQ\Cachet\Models\Setting;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
/**
|
||||
* This is the setting model test class.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
*/
|
||||
class SettingTest extends AbstractTestCase
|
||||
{
|
||||
public function testValidation()
|
||||
{
|
||||
$this->assertFalse(property_exists(new Setting(), 'rules'));
|
||||
}
|
||||
}
|
||||
31
tests/Models/SubscriberTest.php
Normal file
31
tests/Models/SubscriberTest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Tests\Cachet\Models;
|
||||
|
||||
use AltThree\TestBench\ValidationTrait;
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
/**
|
||||
* This is the subscriber model test class.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
*/
|
||||
class SubscriberTest extends AbstractTestCase
|
||||
{
|
||||
use ValidationTrait;
|
||||
|
||||
public function testValidation()
|
||||
{
|
||||
$this->checkRules(new Subscriber());
|
||||
}
|
||||
}
|
||||
31
tests/Models/SubscriptionTest.php
Normal file
31
tests/Models/SubscriptionTest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Tests\Cachet\Models;
|
||||
|
||||
use AltThree\TestBench\ValidationTrait;
|
||||
use CachetHQ\Cachet\Models\Subscription;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
/**
|
||||
* This is the subscription model test class.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
*/
|
||||
class SubscriptionTest extends AbstractTestCase
|
||||
{
|
||||
use ValidationTrait;
|
||||
|
||||
public function testValidation()
|
||||
{
|
||||
$this->checkRules(new Subscription());
|
||||
}
|
||||
}
|
||||
28
tests/Models/TagTest.php
Normal file
28
tests/Models/TagTest.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Tests\Cachet\Models;
|
||||
|
||||
use CachetHQ\Cachet\Models\Tag;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
/**
|
||||
* This is the tag model test class.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
*/
|
||||
class TagTest extends AbstractTestCase
|
||||
{
|
||||
public function testValidation()
|
||||
{
|
||||
$this->assertFalse(property_exists(new Tag(), 'rules'));
|
||||
}
|
||||
}
|
||||
31
tests/Models/UserTest.php
Normal file
31
tests/Models/UserTest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Tests\Cachet\Models;
|
||||
|
||||
use AltThree\TestBench\ValidationTrait;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
/**
|
||||
* This is the user model test class.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
*/
|
||||
class UserTest extends AbstractTestCase
|
||||
{
|
||||
use ValidationTrait;
|
||||
|
||||
public function testValidation()
|
||||
{
|
||||
$this->checkRules(new User());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user