File tree Expand file tree Collapse file tree 3 files changed +16
-5
lines changed
app/code/Magento/Customer/Model
dev/tests/integration/testsuite/Magento Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change 1414 *
1515 * @package Magento\Customer\Model
1616 * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
17+ * @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
1718 */
1819class Visitor extends \Magento \Framework \Model \AbstractModel
1920{
@@ -168,10 +169,6 @@ public function initByRequest($observer)
168169
169170 $ this ->setLastVisitAt ((new \DateTime ())->format (\Magento \Framework \Stdlib \DateTime::DATETIME_PHP_FORMAT ));
170171
171- // prevent saving Visitor for safe methods, e.g. GET request
172- if ($ this ->requestSafety ->isSafeMethod ()) {
173- return $ this ;
174- }
175172 if (!$ this ->getId ()) {
176173 $ this ->setSessionId ($ this ->session ->getSessionId ());
177174 $ this ->save ();
Original file line number Diff line number Diff line change 1313 * @magentoDbIsolation disabled
1414 * @magentoIndexerDimensionMode catalog_product_price website_and_customer_group
1515 * @group indexer_dimension
16- * @magentoAppArea frontend
1716 */
1817class FixedBundlePriceCalculatorWithDimensionTest extends BundlePriceAbstract
1918{
Original file line number Diff line number Diff line change @@ -751,6 +751,21 @@ public function loginPostRedirectDataProvider()
751751 ];
752752 }
753753
754+ /**
755+ * @magentoDataFixture Magento/Customer/_files/customer.php
756+ * @magentoDataFixture Magento/Customer/_files/customer_address.php
757+ * @magentoAppArea frontend
758+ */
759+ public function testCheckVisitorModel ()
760+ {
761+ /** @var \Magento\Customer\Model\Visitor $visitor */
762+ $ visitor = $ this ->_objectManager ->get (\Magento \Customer \Model \Visitor::class);
763+ $ this ->login (1 );
764+ $ this ->assertNull ($ visitor ->getId ());
765+ $ this ->dispatch ('customer/account/index ' );
766+ $ this ->assertNotNull ($ visitor ->getId ());
767+ }
768+
754769 /**
755770 * @param string $email
756771 * @return void
You can’t perform that action at this time.
0 commit comments