From 4853f0a4dec3464951d067d2f6c8fe17cb948e37 Mon Sep 17 00:00:00 2001 From: gloas <gloas@afi-sa.fr> Date: Tue, 28 Aug 2018 10:45:20 +0200 Subject: [PATCH] hotline #78596 fix features list --- VERSIONS_HOTLINE/78596 | 2 ++ library/Class/Feature.php | 2 +- .../controllers/FeatureControllerTest.php | 22 +++++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 VERSIONS_HOTLINE/78596 diff --git a/VERSIONS_HOTLINE/78596 b/VERSIONS_HOTLINE/78596 new file mode 100644 index 00000000000..aea3097ab8d --- /dev/null +++ b/VERSIONS_HOTLINE/78596 @@ -0,0 +1,2 @@ + - ticket #78596 : Administration : correction de la liste des nouvelles fonctionnalités lorsqu'une fonctionnalité supprimé avait été marquée comme vue. + \ No newline at end of file diff --git a/library/Class/Feature.php b/library/Class/Feature.php index 792f3405e50..8721eced010 100644 --- a/library/Class/Feature.php +++ b/library/Class/Feature.php @@ -84,7 +84,7 @@ class Class_Feature { if(!$ids) return []; - return array_values(array_map([$this, 'find'], $ids)); + return array_filter(array_values(array_map([$this, 'find'], $ids))); } diff --git a/tests/application/modules/admin/controllers/FeatureControllerTest.php b/tests/application/modules/admin/controllers/FeatureControllerTest.php index b3689fcb4c0..5d4f3d62a47 100644 --- a/tests/application/modules/admin/controllers/FeatureControllerTest.php +++ b/tests/application/modules/admin/controllers/FeatureControllerTest.php @@ -163,4 +163,26 @@ class FeatureControllerShowDispatchTest extends Admin_AbstractControllerTestCase public function featureShouldAppearAsNewForUser() { $this->assertNotNull((new Class_Feature)->findNewFor(Class_Users::getIdentity())[0]->getId()); } +} + + + + +class FeatureControllerNullFeatureTest extends ModelTestCase { + protected $_storm_default_to_volatile = true; + + + /** @test */ + public function contextShouldExpectation() { + $user = $this->fixture('Class_Users', + ['id' => 3232, + 'login' => 'I check features', + 'password' => 'because i m strong']); + + Class_User_Settings::newWith($user) + ->addCheckedFeature(789789789798) + ->save(); + + $this->assertNotNull((new Class_Feature)->findNewFor($user)); + } } \ No newline at end of file -- GitLab