Mercurial > hg > isophonics-drupal-site
comparison core/modules/path/tests/src/Kernel/PathItemTest.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | 7a779792577d |
children |
comparison
equal
deleted
inserted
replaced
13:5fb285c0d0e3 | 14:1fec387a4317 |
---|---|
187 $this->assertTrue($node->get('path')->equals($second_node->get('path'))); | 187 $this->assertTrue($node->get('path')->equals($second_node->get('path'))); |
188 | 188 |
189 // Change the alias for the second node to a different one and try again. | 189 // Change the alias for the second node to a different one and try again. |
190 $second_node->get('path')->alias = '/foobar'; | 190 $second_node->get('path')->alias = '/foobar'; |
191 $this->assertFalse($node->get('path')->equals($second_node->get('path'))); | 191 $this->assertFalse($node->get('path')->equals($second_node->get('path'))); |
192 | |
193 // Test the generateSampleValue() method. | |
194 $node = Node::create([ | |
195 'title' => $this->randomString(), | |
196 'type' => 'foo', | |
197 'path' => ['alias' => '/foo'], | |
198 ]); | |
199 $node->save(); | |
200 $path_field = $node->get('path'); | |
201 $path_field->generateSampleItems(); | |
202 $node->save(); | |
203 $this->assertStringStartsWith('/', $node->get('path')->alias); | |
192 } | 204 } |
193 | 205 |
194 } | 206 } |