Exemplo n.º 1
0
 /**
  * Saves an advertiser & makes sure the body field is set.
  */
 public function testAdvertiserBody()
 {
     $body = 'A reasonably long chunk of text representing a description of this particular advertiser. A bit like the blurb on the back of a book.';
     // Create an entity.
     $entity = Advertiser::create(['advertiser_body' => $body]);
     // Save it.
     $entity->save();
     // Get the id.
     $id = $entity->id();
     // Load the saved entity.
     $saved_entity = Advertiser::load($id);
     // Get the website address from the website.
     $advertiser_body = $saved_entity->getBody();
     // Check the website field matches.
     $this->assertEqual($body, $advertiser_body, 'Body field successfully set', 'body');
 }