Skip to content

Commit

Permalink
[#14213] - More corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
niden committed Jul 4, 2019
1 parent bd88651 commit 6ecab89
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use IntegrationTester;
use Phalcon\Mvc\Model\AbstractModel;
use Phalcon\Mvc\Model\Enum;
use Phalcon\Test\Fixtures\Traits\DiTrait;
use Phalcon\Test\Models\AlbumORama\Albums;
use Phalcon\Test\Models\AlbumORama\Artists;
Expand Down Expand Up @@ -107,7 +108,7 @@ private function executeSaveRelatedBelongsTo(IntegrationTester $I)
//
//The artists must no be saved
$I->assertEquals(
Model::DIRTY_STATE_TRANSIENT,
Enum::DIRTY_STATE_TRANSIENT,
$artist->getDirtyState()
);

Expand All @@ -133,12 +134,12 @@ private function executeSaveRelatedBelongsTo(IntegrationTester $I)

//The artist model was saved correctly but album not
$I->assertEquals(
Model::DIRTY_STATE_PERSISTENT,
Enum::DIRTY_STATE_PERSISTENT,
$artist->getDirtyState()
);

$I->assertEquals(
Model::DIRTY_STATE_TRANSIENT,
Enum::DIRTY_STATE_TRANSIENT,
$album->getDirtyState()
);

Expand All @@ -163,12 +164,12 @@ private function executeSaveRelatedBelongsTo(IntegrationTester $I)

//Both messages must be saved correctly
$I->assertEquals(
Model::DIRTY_STATE_PERSISTENT,
Enum::DIRTY_STATE_PERSISTENT,
$artist->getDirtyState()
);

$I->assertEquals(
Model::DIRTY_STATE_PERSISTENT,
Enum::DIRTY_STATE_PERSISTENT,
$album->getDirtyState()
);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/Mvc/Model/Refactor-SnapshotCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ public function testDisabledSnapshotUpdate(IntegrationTester $I)
$I->skipTest('TODO = Check test');
$robots = Robots::findFirst();

Model::setup(
AbstractModel::setup(
[
'updateSnapshotOnSave' => false,
]
Expand All @@ -638,7 +638,7 @@ public function testDisabledSnapshotUpdate(IntegrationTester $I)
$robots->hasChanged('name')
);

Model::setup(
AbstractModel::setup(
[
'updateSnapshotOnSave' => true,
]
Expand Down
7 changes: 4 additions & 3 deletions tests/integration/Mvc/Model/SaveCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

use IntegrationTester;
use Phalcon\Mvc\Model\AbstractModel;
use Phalcon\Mvc\Model\Enum;
use Phalcon\Mvc\Model\MetaData;
use Phalcon\Test\Fixtures\Traits\DiTrait;
use Phalcon\Test\Models\AlbumORama\Albums;
Expand Down Expand Up @@ -186,17 +187,17 @@ public function mvcModelSaveWithRelatedRecords(IntegrationTester $I)
);

$I->assertEquals(
Model::DIRTY_STATE_PERSISTENT,
Enum::DIRTY_STATE_PERSISTENT,
$robotPart->getDirtyState()
);

$I->assertEquals(
Model::DIRTY_STATE_PERSISTENT,
Enum::DIRTY_STATE_PERSISTENT,
$robotPart->robot->getDirtyState()
);

$I->assertEquals(
Model::DIRTY_STATE_PERSISTENT,
Enum::DIRTY_STATE_PERSISTENT,
$part->getDirtyState()
);

Expand Down
13 changes: 7 additions & 6 deletions tests/integration/Mvc/Model/UnderscoreSetCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use IntegrationTester;
use Phalcon\Mvc\Model\AbstractModel;
use Phalcon\Mvc\Model\Enum;
use Phalcon\Test\Fixtures\Traits\DiTrait;
use Phalcon\Test\Models;

Expand Down Expand Up @@ -133,7 +134,7 @@ public function mvcModelUnderscoreSetWithBelongsToRelatedRecord(IntegrationTeste
);

$I->assertEquals(
Model::DIRTY_STATE_TRANSIENT,
Enum::DIRTY_STATE_TRANSIENT,
$robotPart->getDirtyState()
);
}
Expand All @@ -160,7 +161,7 @@ public function mvcModelUnderscoreSetWithArrayOfBelongsToRelatedRecord(Integrati

$I->assertEquals(
$robotPart->getDirtyState(),
Model::DIRTY_STATE_TRANSIENT
Enum::DIRTY_STATE_TRANSIENT
);

$I->assertEquals(
Expand Down Expand Up @@ -190,7 +191,7 @@ public function mvcModelUnderscoreSetWithHasOneRelatedRecord(IntegrationTester $
);

$I->assertEquals(
Model::DIRTY_STATE_TRANSIENT,
Enum::DIRTY_STATE_TRANSIENT,
$customer->getDirtyState()
);
}
Expand All @@ -216,7 +217,7 @@ public function mvcModelUnderscoreSetWithArrayOfHasOneRelatedRecord(IntegrationT
);

$I->assertEquals(
Model::DIRTY_STATE_TRANSIENT,
Enum::DIRTY_STATE_TRANSIENT,
$customer->getDirtyState()
);

Expand Down Expand Up @@ -260,7 +261,7 @@ public function mvcModelUnderscoreSetWithHasManyRelatedRecords(IntegrationTester
);

$I->assertEquals(
Model::DIRTY_STATE_TRANSIENT,
Enum::DIRTY_STATE_TRANSIENT,
$robot->getDirtyState()
);
}
Expand Down Expand Up @@ -299,7 +300,7 @@ public function mvcModelUnderscoreSetWithHasManyToManyRelatedRecords(Integration
);

$I->assertEquals(
Model::DIRTY_STATE_TRANSIENT,
Enum::DIRTY_STATE_TRANSIENT,
$robot->getDirtyState()
);
}
Expand Down

0 comments on commit 6ecab89

Please sign in to comment.