File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
dev/tests/integration/testsuite/Magento/Catalog/Model/Attribute/Backend Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,9 @@ public function testBeforeSave(): void
6161 }
6262
6363 /**
64+ * Test that Product with attribute "Set Product as New"
65+ * with starting date and with expired ending date throws Exception.
66+ *
6467 * @return void
6568 */
6669 public function testValidate (): void
@@ -72,4 +75,19 @@ public function testValidate(): void
7275 $ this ->expectExceptionMessage ((string )$ msg );
7376 $ this ->startDate ->validate ($ product );
7477 }
78+
79+ /**
80+ * Test that Product with attribute "Set Product as New"
81+ * without starting date and with expired ending date doesn't throw Exception.
82+ *
83+ * @return void
84+ */
85+ public function testValidatePastEndWithNoStart (): void
86+ {
87+ $ product = $ this ->productFactory ->create ();
88+ $ actualResult = $ this ->startDate ->validate ($ product );
89+ $ this ->assertEquals (true , $ actualResult );
90+ $ noException = $ this ->getExpectedExceptionMessage ();
91+ $ this ->assertNull ($ noException );
92+ }
7593}
You can’t perform that action at this time.
0 commit comments