@@ 94-124 (lines=31) @@ | ||
91 | * |
|
92 | * @return string |
|
93 | */ |
|
94 | public function testUpdate($name) |
|
95 | { |
|
96 | $response = $this->client->requestGrid( |
|
97 | 'sales-lead-grid', |
|
98 | ['sales-lead-grid[_filter][name][value]' => $name] |
|
99 | ); |
|
100 | ||
101 | $result = $this->getJsonResponseContent($response, 200); |
|
102 | $result = reset($result['data']); |
|
103 | $returnValue = $result; |
|
104 | $crawler = $this->client->request( |
|
105 | 'GET', |
|
106 | $this->getUrl('orocrm_sales_lead_update', ['id' => $result['id']]) |
|
107 | ); |
|
108 | ||
109 | /** @var Form $form */ |
|
110 | $form = $crawler->selectButton('Save and Close')->form(); |
|
111 | $name = 'name' . $this->generateRandomString(); |
|
112 | $form['orocrm_sales_lead_form[name]'] = $name; |
|
113 | ||
114 | $this->client->followRedirects(true); |
|
115 | $crawler = $this->client->submit($form); |
|
116 | ||
117 | $result = $this->client->getResponse(); |
|
118 | $this->assertHtmlResponseStatusCodeEquals($result, 200); |
|
119 | $this->assertContains("Lead saved", $crawler->html()); |
|
120 | ||
121 | $returnValue['name'] = $name; |
|
122 | ||
123 | return $returnValue; |
|
124 | } |
|
125 | ||
126 | /** |
|
127 | * @param array $returnValue |
@@ 84-117 (lines=34) @@ | ||
81 | * |
|
82 | * @return string |
|
83 | */ |
|
84 | public function testUpdate($name) |
|
85 | { |
|
86 | $response = $this->client->requestGrid( |
|
87 | 'sales-opportunity-grid', |
|
88 | [ |
|
89 | 'sales-opportunity-grid[_filter][name][type]' => '1', |
|
90 | 'sales-opportunity-grid[_filter][name][value]' => $name, |
|
91 | ] |
|
92 | ); |
|
93 | ||
94 | $result = $this->getJsonResponseContent($response, 200); |
|
95 | $result = reset($result['data']); |
|
96 | $returnValue = $result; |
|
97 | $crawler = $this->client->request( |
|
98 | 'GET', |
|
99 | $this->getUrl('orocrm_sales_opportunity_update', ['id' => $result['id']]) |
|
100 | ); |
|
101 | ||
102 | /** @var Form $form */ |
|
103 | $form = $crawler->selectButton('Save and Close')->form(); |
|
104 | $name = 'name' . $this->generateRandomString(); |
|
105 | $form['orocrm_sales_opportunity_form[name]'] = $name; |
|
106 | ||
107 | $this->client->followRedirects(true); |
|
108 | $crawler = $this->client->submit($form); |
|
109 | ||
110 | $result = $this->client->getResponse(); |
|
111 | $this->assertHtmlResponseStatusCodeEquals($result, 200); |
|
112 | $this->assertContains("Opportunity saved", $crawler->html()); |
|
113 | ||
114 | $returnValue['name'] = $name; |
|
115 | ||
116 | return $returnValue; |
|
117 | } |
|
118 | ||
119 | /** |
|
120 | * @param array $returnValue |