Skip to content

Commit

Permalink
Merge pull request #4 from Thibcabanes/fix/132869
Browse files Browse the repository at this point in the history
[FIX#132869] Modification lib pour la date d'update de la moulinette
  • Loading branch information
Kumatetsu authored Apr 1, 2019
2 parents 5336772 + 039e4d5 commit 0333779
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 16 deletions.
1 change: 0 additions & 1 deletion .coveralls.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
src_dir: ./
coverage_clover: build/logs/clover.xml
4 changes: 2 additions & 2 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ env:
- APPLICATION_ENV=drone
script:
- composer install --dev --no-interaction --prefer-source
- bin/phing
- bin/coveralls
- composer phing
- composer coveralls
notify:
slack:
team: {{slackTeam}}
Expand Down
5 changes: 1 addition & 4 deletions Tests/ModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,7 @@ public function testSetCreatedAt()

public function testSetUpdatedAt()
{
$this->model->setUpdatedAtBeforePersist();
$this->assertEquals(date('Y-m-d H:i:s'), $this->model->getUpdatedAt('Y-m-d H:i:s'));

$this->model->setUpdatedAtBeforeUpdate();
$this->model->setUpdatedAt();
$this->assertEquals(date('Y-m-d H:i:s'), $this->model->getUpdatedAt('Y-m-d H:i:s'));
}

Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
},
"scripts" : {
"phing": "phing",
"coveralls": "coveralls",
"post-install-cmd": [
"mkdir -p build",
"chmod 777 build"
Expand Down
11 changes: 2 additions & 9 deletions src/UpdatedAt.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,11 @@ public function getUpdatedAt($format = null)
}
}

/**
* @PrePersist
*/
public function setUpdatedAtBeforePersist()
{
$this->updated_at = new \DateTime(date('Y-m-d H:i:s'));
}

/**
* @PreUpdate
* @PrePersist
*/
public function setUpdatedAtBeforeUpdate()
public function setUpdatedAt()
{
$this->updated_at = new \DateTime(date('Y-m-d H:i:s'));
}
Expand Down

0 comments on commit 0333779

Please sign in to comment.