Skip to content
Permalink
Browse files

Rename poorly named tests and remove redundant test.

  • Loading branch information...
markstory committed Apr 2, 2018
1 parent 381c60b commit 8ec460cc66ce2e3da3517eaa4190b39dde6b1b51
Showing with 12 additions and 80 deletions.
  1. +12 −80 tests/TestCase/ORM/RulesCheckerIntegrationTest.php
@@ -891,9 +891,9 @@ public function testExistsInErrorWithArrayField()
/**
* Tests new allowNullableNulls flag with author id set to null
*
* @return
* @return void
*/
public function testExistsInAllowNullableNullsWithAuthorIdNullA()
public function testExistsInAllowNullableNullsOn()
{
$entity = new Entity([
'id' => 10,
@@ -914,9 +914,9 @@ public function testExistsInAllowNullableNullsWithAuthorIdNullA()
/**
* Tests new allowNullableNulls flag with author id set to null
*
* @return
* @return void
*/
public function testExistsInAllowNullableNullsWithAuthorIdNullB()
public function testExistsInAllowNullableNullsOff()
{
$entity = new Entity([
'id' => 10,
@@ -939,7 +939,7 @@ public function testExistsInAllowNullableNullsWithAuthorIdNullB()
*
* @return
*/
public function testExistsInAllowNullableNullsWithAuthorIdNullC()
public function testExistsInAllowNullableNullsDefaultValue()
{
$entity = new Entity([
'id' => 10,
@@ -960,7 +960,7 @@ public function testExistsInAllowNullableNullsWithAuthorIdNullC()
*
* @return
*/
public function testExistsInAllowNullableNullsWithAuthorIdNullD()
public function testExistsInAllowNullableNullsCustomMessage()
{
$entity = new Entity([
'id' => 10,
@@ -980,36 +980,12 @@ public function testExistsInAllowNullableNullsWithAuthorIdNullD()
$this->assertEquals(['author_id' => ['_existsIn' => 'Niente']], $entity->errors());
}
/**
* Tests new allowNullableNulls flag with author id set to null
*
* @return
*/
public function testExistsInAllowNullableNullsWithAuthorIdNullE()
{
$entity = new Entity([
'id' => 10,
'author_id' => null,
'site_id' => 1,
'name' => 'New Site Article without Author',
]);
$table = TableRegistry::get('SiteArticles');
$table->belongsTo('SiteAuthors');
$rules = $table->rulesChecker();
$rules->add($rules->existsIn(['author_id', 'site_id'], 'SiteAuthors', [
'allowNullableNulls' => true,
'message' => 'Niente'
]));
$this->assertInstanceOf('Cake\ORM\Entity', $table->save($entity));
}
/**
* Tests new allowNullableNulls flag with author id set to 1
*
* @return
*/
public function testExistsInAllowNullableNullsWithAuthorId1A()
public function testExistsInAllowNullableNullsOnAllKeysSet()
{
$entity = new Entity([
'id' => 10,
@@ -1030,7 +1006,7 @@ public function testExistsInAllowNullableNullsWithAuthorId1A()
*
* @return
*/
public function testExistsInAllowNullableNullsWithAuthorIdB()
public function testExistsInAllowNullableNullsOffAllKeysSet()
{
$entity = new Entity([
'id' => 10,
@@ -1051,28 +1027,7 @@ public function testExistsInAllowNullableNullsWithAuthorIdB()
*
* @return
*/
public function testExistsInAllowNullableNullsWithAuthorId1C()
{
$entity = new Entity([
'id' => 10,
'author_id' => 1,
'site_id' => 1,
'name' => 'New Site Article with Author',
]);
$table = TableRegistry::get('SiteArticles');
$table->belongsTo('SiteAuthors');
$rules = $table->rulesChecker();
$rules->add($rules->existsIn(['author_id', 'site_id'], 'SiteAuthors'));
$this->assertInstanceOf('Cake\ORM\Entity', $table->save($entity));
}
/**
* Tests new allowNullableNulls flag with author id set to 1
*
* @return
*/
public function testExistsInAllowNullableNullsWithAuthorId1E()
public function testExistsInAllowNullableNullsOnAllKeysCustomMessage()
{
$entity = new Entity([
'id' => 10,
@@ -1090,35 +1045,12 @@ public function testExistsInAllowNullableNullsWithAuthorId1E()
$this->assertInstanceOf('Cake\ORM\Entity', $table->save($entity));
}
/**
* Tests new allowNullableNulls flag with author id set to 1
*
* @return
*/
public function testExistsInAllowNullableNullsWithAuthorId1F()
{
$entity = new Entity([
'id' => 10,
'author_id' => 1,
'site_id' => 1,
'name' => 'New Site Article with Author',
]);
$table = TableRegistry::get('SiteArticles');
$table->belongsTo('SiteAuthors');
$rules = $table->rulesChecker();
$rules->add($rules->existsIn(['author_id', 'site_id'], 'SiteAuthors', [
'allowNullableNulls' => false,
'message' => 'will not error']));
$this->assertInstanceOf('Cake\ORM\Entity', $table->save($entity));
}
/**
* Tests new allowNullableNulls flag with author id set to 99999999 (does not exist)
*
* @return
*/
public function testExistsInAllowNullableNullsWithAuthorId1G()
public function testExistsInAllowNullableNullsOnInvalidKey()
{
$entity = new Entity([
'id' => 10,
@@ -1143,7 +1075,7 @@ public function testExistsInAllowNullableNullsWithAuthorId1G()
*
* @return
*/
public function testExistsInAllowNullableNullsWithAuthorId1H()
public function testExistsInAllowNullableNullsOnInvalidKeys()
{
$entity = new Entity([
'id' => 10,
@@ -1168,7 +1100,7 @@ public function testExistsInAllowNullableNullsWithAuthorId1H()
*
* @return
*/
public function testExistsInAllowNullableNullsWithAuthorId1I()
public function testExistsInAllowNullableNullsOnInvalidKeySecond()
{
$entity = new Entity([
'id' => 10,

0 comments on commit 8ec460c

Please sign in to comment.
You can’t perform that action at this time.