Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added some very basic model tests #2017

Merged
merged 1 commit into from
Jul 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"roumen/feed": "^2.10.4"
},
"require-dev": {
"alt-three/testbench": "^1.7",
"alt-three/testbench": "^1.8",
"filp/whoops": "^2.1",
"fzaninotto/faker": "^1.6",
"graham-campbell/testbench-core": "^1.1",
Expand Down
16 changes: 8 additions & 8 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions tests/Models/ComponentGroupTest.php
Original file line number Diff line number Diff line change
@@ -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 changes: 31 additions & 0 deletions tests/Models/ComponentTest.php
Original file line number Diff line number Diff line change
@@ -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 changes: 31 additions & 0 deletions tests/Models/IncidentTemplateTest.php
Original file line number Diff line number Diff line change
@@ -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 changes: 31 additions & 0 deletions tests/Models/IncidentTest.php
Original file line number Diff line number Diff line change
@@ -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 changes: 28 additions & 0 deletions tests/Models/InviteTest.php
Original file line number Diff line number Diff line change
@@ -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 changes: 31 additions & 0 deletions tests/Models/MetricPointTest.php
Original file line number Diff line number Diff line change
@@ -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 changes: 31 additions & 0 deletions tests/Models/MetricTest.php
Original file line number Diff line number Diff line change
@@ -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 changes: 30 additions & 0 deletions tests/Models/ModelExistenceTest.php
Original file line number Diff line number Diff line change
@@ -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 changes: 28 additions & 0 deletions tests/Models/SettingTest.php
Original file line number Diff line number Diff line change
@@ -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 changes: 31 additions & 0 deletions tests/Models/SubscriberTest.php
Original file line number Diff line number Diff line change
@@ -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());
}
}
Loading