@@ -902,6 +902,31 @@ public function testMetaTitle()
902902 $ this ->assertNotSame ($ product ->getVersion (), $ result ->getVersion ());
903903 }
904904
905+ public function testMetaTitlePublish ()
906+ {
907+ $ draft = $ this ->getDraft ('meta-title ' );
908+ $ product = $ this ->createProduct ($ draft );
909+
910+ $ metaTitle = $ this ->getTestRun () . '-meta-title ' ;
911+ $ request = ProductUpdateRequest::ofIdAndVersion ($ product ->getId (), $ product ->getVersion ())
912+ ->addAction (
913+ ProductSetMetaTitleAction::of ()->setMetaTitle (
914+ LocalizedString::ofLangAndText ('en ' , $ metaTitle )
915+ )->setStaged (false )
916+ )
917+ ;
918+ $ response = $ request ->executeWithClient ($ this ->getClient ());
919+ $ result = $ request ->mapResponse ($ response );
920+ $ this ->deleteRequest ->setVersion ($ result ->getVersion ());
921+
922+ $ this ->assertInstanceOf (Product::class, $ result );
923+ $ this ->assertSame (
924+ $ metaTitle ,
925+ $ result ->getMasterData ()->getCurrent ()->getMetaTitle ()->en
926+ );
927+ $ this ->assertNotSame ($ product ->getVersion (), $ result ->getVersion ());
928+ }
929+
905930 public function testMetaDescription ()
906931 {
907932 $ draft = $ this ->getDraft ('meta-description ' );
@@ -928,6 +953,31 @@ public function testMetaDescription()
928953 $ this ->assertNotSame ($ product ->getVersion (), $ result ->getVersion ());
929954 }
930955
956+ public function testMetaDescriptionPublish ()
957+ {
958+ $ draft = $ this ->getDraft ('meta-description ' );
959+ $ product = $ this ->createProduct ($ draft );
960+
961+ $ metaDescription = $ this ->getTestRun () . '-meta-description ' ;
962+ $ request = ProductUpdateRequest::ofIdAndVersion ($ product ->getId (), $ product ->getVersion ())
963+ ->addAction (
964+ ProductSetMetaDescriptionAction::of ()->setMetaDescription (
965+ LocalizedString::ofLangAndText ('en ' , $ metaDescription )
966+ )->setStaged (false )
967+ )
968+ ;
969+ $ response = $ request ->executeWithClient ($ this ->getClient ());
970+ $ result = $ request ->mapResponse ($ response );
971+ $ this ->deleteRequest ->setVersion ($ result ->getVersion ());
972+
973+ $ this ->assertInstanceOf (Product::class, $ result );
974+ $ this ->assertSame (
975+ $ metaDescription ,
976+ $ result ->getMasterData ()->getCurrent ()->getMetaDescription ()->en
977+ );
978+ $ this ->assertNotSame ($ product ->getVersion (), $ result ->getVersion ());
979+ }
980+
931981 public function testMetaKeywords ()
932982 {
933983 $ draft = $ this ->getDraft ('meta-keywords ' );
@@ -954,6 +1004,31 @@ public function testMetaKeywords()
9541004 $ this ->assertNotSame ($ product ->getVersion (), $ result ->getVersion ());
9551005 }
9561006
1007+ public function testMetaKeywordsPublish ()
1008+ {
1009+ $ draft = $ this ->getDraft ('meta-keywords ' );
1010+ $ product = $ this ->createProduct ($ draft );
1011+
1012+ $ metaKeywords = $ this ->getTestRun () . '-meta-keywords ' ;
1013+ $ request = ProductUpdateRequest::ofIdAndVersion ($ product ->getId (), $ product ->getVersion ())
1014+ ->addAction (
1015+ ProductSetMetaKeywordsAction::of ()->setMetaKeywords (
1016+ LocalizedString::ofLangAndText ('en ' , $ metaKeywords )
1017+ )->setStaged (false )
1018+ )
1019+ ;
1020+ $ response = $ request ->executeWithClient ($ this ->getClient ());
1021+ $ result = $ request ->mapResponse ($ response );
1022+ $ this ->deleteRequest ->setVersion ($ result ->getVersion ());
1023+
1024+ $ this ->assertInstanceOf (Product::class, $ result );
1025+ $ this ->assertSame (
1026+ $ metaKeywords ,
1027+ $ result ->getMasterData ()->getCurrent ()->getMetaKeywords ()->en
1028+ );
1029+ $ this ->assertNotSame ($ product ->getVersion (), $ result ->getVersion ());
1030+ }
1031+
9571032 public function testRevertStagedChanges ()
9581033 {
9591034 $ draft = $ this ->getDraft ('revert ' );
0 commit comments