Skip to content

Commit

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

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 @@ -108,7 +107,7 @@ private function executeSaveRelatedBelongsTo(IntegrationTester $I)
//
//The artists must no be saved
$I->assertEquals(
Enum::DIRTY_STATE_TRANSIENT,
Model::DIRTY_STATE_TRANSIENT,
$artist->getDirtyState()
);

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

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

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

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

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

$I->assertEquals(
Enum::DIRTY_STATE_PERSISTENT,
Model::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();

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

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

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 @@ -187,17 +186,17 @@ public function mvcModelSaveWithRelatedRecords(IntegrationTester $I)
);

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

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

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

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

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 @@ -134,7 +133,7 @@ public function mvcModelUnderscoreSetWithBelongsToRelatedRecord(IntegrationTeste
);

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

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

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

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

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

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

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

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

0 comments on commit bf2a23d

Please sign in to comment.