commit 6030e52e784e186e6f44068c7560ba4183e5ec99 Author: Tim Plunkett Date: Wed May 27 10:26:47 2015 -0400 adjust ajax form page cache test. diff --git a/core/modules/system/src/Tests/Ajax/AjaxFormPageCacheTest.php b/core/modules/system/src/Tests/Ajax/AjaxFormPageCacheTest.php index c5dafbe..03727b6 100644 --- a/core/modules/system/src/Tests/Ajax/AjaxFormPageCacheTest.php +++ b/core/modules/system/src/Tests/Ajax/AjaxFormPageCacheTest.php @@ -54,9 +54,15 @@ public function testSimpleAJAXFormValue() { $this->assertCommand($commands, $expected, 'Build id change command issued on first AJAX submission'); $edit = ['select' => 'red']; - $this->drupalPostAjaxForm(NULL, $edit, 'select'); + $commands = $this->drupalPostAjaxForm(NULL, $edit, 'select'); $build_id_second_ajax = $this->getFormBuildId(); - $this->assertEqual($build_id_first_ajax, $build_id_second_ajax, 'Build id remains the same on subsequent AJAX submissions'); + $this->assertNotEqual($build_id_first_ajax, $build_id_second_ajax, 'Build id changes on subsequent AJAX submissions'); + $expected = [ + 'command' => 'update_build_id', + 'old' => $build_id_first_ajax, + 'new' => $build_id_second_ajax, + ]; + $this->assertCommand($commands, $expected, 'Build id change command issued on subsequent AJAX submissions'); // Repeat the test sequence but this time with a page loaded from the cache. $this->drupalGet('ajax_forms_test_get_form'); @@ -77,9 +83,15 @@ public function testSimpleAJAXFormValue() { $this->assertCommand($commands, $expected, 'Build id change command issued on first AJAX submission'); $edit = ['select' => 'red']; - $this->drupalPostAjaxForm(NULL, $edit, 'select'); + $commands = $this->drupalPostAjaxForm(NULL, $edit, 'select'); $build_id_from_cache_second_ajax = $this->getFormBuildId(); - $this->assertEqual($build_id_from_cache_first_ajax, $build_id_from_cache_second_ajax, 'Build id remains the same on subsequent AJAX submissions'); + $this->assertNotEqual($build_id_from_cache_first_ajax, $build_id_from_cache_second_ajax, 'Build id changes on subsequent AJAX submissions'); + $expected = [ + 'command' => 'update_build_id', + 'old' => $build_id_from_cache_first_ajax, + 'new' => $build_id_from_cache_second_ajax, + ]; + $this->assertCommand($commands, $expected, 'Build id change command issued on subsequent AJAX submissions'); } /**