title: Fatal error: Call to a member function trigger() on a non-object in .../model.php on line 2106 when running as CakeTestCase
body: <p>I'm a newbie to PHP, CakePHP, and the CakePHP unit testing framework for 1.3.</p>
  
  <p>I created a simple test case of a model and ran into this error:</p>
  
  <blockquote>
    <p>Fatal error: Call to a member function
    trigger() on a non-object in
    /Users/calvinc/Sites/lhasa/web/cake/libs/model/model.php
    on line 2106</p>
  </blockquote>
  
  <p>I notice that the line 2106 in model.php is as follows:</p>
  
  <blockquote>
  <pre><code>  if ($query['callbacks'] === true || $query['callbacks'] === 'before') {
        $return = $this-&gt;Behaviors-&gt;trigger($this, 'beforeFind', array($query), array(
  </code></pre>
  </blockquote>
  
  <p>I'm guessing that Behaviors is not setup. What would be the cause of that?</p>
  
  <p>Here's the dump of the Login object.</p>
  
  <p>[Wed Mar 02 11:06:26 2011] [error] [client 127.0.0.1] Login Object
  (
      [actsAs] => Array
          (
              [0] => Containable
          )</p>
  
  <pre><code>[utcOffset] =&gt; 8
  [useDbConfig] =&gt; default
  [useTable] =&gt; 
  [displayField] =&gt; 
  [id] =&gt; 
  [data] =&gt; Array
      (
      )
  
  [table] =&gt; 
  [primaryKey] =&gt; 
  [_schema] =&gt; 
  [validationErrors] =&gt; Array
      (
      )
  
  [tablePrefix] =&gt; 
  [name] =&gt; 
  [alias] =&gt; 
  [tableToModel] =&gt; Array
      (
      )
  
  [logTransactions] =&gt; 
  [cacheQueries] =&gt; 
  [belongsTo] =&gt; Array
      (
      )
  
  [hasOne] =&gt; Array
      (
      )
  
  [hasMany] =&gt; Array
      (
      )
  
  [hasAndBelongsToMany] =&gt; Array
      (
      )
  
  [Behaviors] =&gt; 
  [whitelist] =&gt; Array
      (
      )
  
  [cacheSources] =&gt; 1
  [findQueryType] =&gt; 
  [recursive] =&gt; 1
  [order] =&gt; 
  [virtualFields] =&gt; Array
      (
      )
  
  [__associationKeys] =&gt; Array
      (
          [belongsTo] =&gt; Array
              (
                  [0] =&gt; className
                  [1] =&gt; foreignKey
                  [2] =&gt; conditions
                  [3] =&gt; fields
                  [4] =&gt; order
                  [5] =&gt; counterCache
              )
  
          [hasOne] =&gt; Array
              (
                  [0] =&gt; className
                  [1] =&gt; foreignKey
                  [2] =&gt; conditions
                  [3] =&gt; fields
                  [4] =&gt; order
                  [5] =&gt; dependent
              )
  
          [hasMany] =&gt; Array
              (
                  [0] =&gt; className
                  [1] =&gt; foreignKey
                  [2] =&gt; conditions
                  [3] =&gt; fields
                  [4] =&gt; order
                  [5] =&gt; limit
                  [6] =&gt; offset
                  [7] =&gt; dependent
                  [8] =&gt; exclusive
                  [9] =&gt; finderQuery
                  [10] =&gt; counterQuery
              )
  
          [hasAndBelongsToMany] =&gt; Array
              (
                  [0] =&gt; className
                  [1] =&gt; joinTable
                  [2] =&gt; with
                  [3] =&gt; foreignKey
                  [4] =&gt; associationForeignKey
                  [5] =&gt; conditions
                  [6] =&gt; fields
                  [7] =&gt; order
                  [8] =&gt; limit
                  [9] =&gt; offset
                  [10] =&gt; unique
                  [11] =&gt; finderQuery
                  [12] =&gt; deleteQuery
                  [13] =&gt; insertQuery
              )
  
      )
  
  [__associations] =&gt; Array
      (
          [0] =&gt; belongsTo
          [1] =&gt; hasOne
          [2] =&gt; hasMany
          [3] =&gt; hasAndBelongsToMany
      )
  
  [__backAssociation] =&gt; Array
      (
      )
  
  [__insertID] =&gt; 
  [__numRows] =&gt; 
  [__affectedRows] =&gt; 
  [_findMethods] =&gt; Array
      (
          [all] =&gt; 1
          [first] =&gt; 1
          [count] =&gt; 1
          [neighbors] =&gt; 1
          [list] =&gt; 1
          [threaded] =&gt; 1
      )
  </code></pre>
  
  <p>)</p>