Q: Drupal - TDD - How to test block title string My drupal block module code is here
<?php

/**
 * Description: This is santa claus block module
 */
function santaclaus_block_info() {
  $blocks = array();
  $blocks['santaclaus'] = array(
    'info' => t('Santa Claus'),
  );
  return $blocks;
}

/**
* Implements hook_block_view().
*/
function santaclaus_block_view($delta = '') {
  $block = array();
  switch ($delta) {
    case 'santaclaus':
      $block['subject'] = 'This is santa claus block';
      $block['content'] = santaclaus_sayhi();
      break;
  }
  return $block;
}

function santaclaus_sayhi() {
  $output = t('Hello world, happy merry christmas');
  return $output;
}

my TDD php file
<?php

/**
 * TDD Code for santa claus block module
 */
define('DRUPAL_ROOT', getcwd());
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
// Bootstrap Drupal.
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);

class TddTests extends PHPUnit_Framework_TestCase {

    /**
     * check block title is santa
     */
    public function testCheckTitleRtnTrue() {
        "what code i want to write here"
    }

}

I want to check $block['subject'] is 'santa' or not ?
how to implement this in "testCheckTitleRtnTrue" TDD file. 
please suggest

A: The way i did is below, please share your thoughts so i can change the TDD code
<?php

/**
 * TDD Code for santa claus block module
 */
define('DRUPAL_ROOT', getcwd());
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
// Bootstrap Drupal.
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);

class santaclaus extends PHPUnit_Framework_TestCase {

    /**
     * check block title is santa
     */
    public function testCheckTitleRtnTrue() {
        $result = module_invoke('santaclaus', 'block_view', 'santaclaus');
        $subject = $result['subject'];
        $subjectIs = 'santa';
        $this->assertEquals($subject, $subjectIs);
    }

}

