You are here

function BeanTests::testRendering in Bean (for Drupal 7) 7

Tests viewing beans.

File

tests/BeanTests.test, line 98
Misc tests.

Class

BeanTests
Basic tests.

Code

function testRendering() {
  $values = array(
    'delta' => 'test_bean',
    'label' => t('Test Bean'),
    'title' => t('Test Bean'),
    'type' => $this->plugin_name,
    'view_mode' => 'default',
    'data' => array(
      'test_boolean' => FALSE,
      'test_string' => t('New String'),
      'test_array' => array(
        'test_array_1' => 'new_value',
      ),
    ),
  );
  $bean = bean_create($values);
  bean_save($bean);
  $this
    ->drupalGet($bean
    ->url());
  $this
    ->assertResponse(200, t('Bean Page is viewable'));
  $this
    ->assertText($bean
    ->label(), t('Bean Page is viewable'));
  $this
    ->drupalGet("block/{$bean->identifier()}");
  $this
    ->assertResponse(200, t('Legacy Bean Page is viewable'));
  $this
    ->assertText($bean
    ->label(), t('Legacy Bean Page is viewable'));
}