@@ -926,7 +926,7 @@ class Table implements RepositoryInterface, EventListenerInterface, EventDispatc
* Get a behavior from the registry.
*
* @param string $name The behavior alias to get from the registry.
- * @return \Cake\ORM\Behavior|null
+ * @return \Cake\ORM\Behavior
*/
public function getBehavior($name)
{
@@ -1795,10 +1795,7 @@ class TableTest extends TestCase
$table = new Table(['table' => 'comments']);
$table->addBehavior('Sluggable');
-
$this->assertSame($table->behaviors()->get('Sluggable'), $table->getBehavior('Sluggable'));
- $this->assertFalse($table->hasBehavior('FakeBehavior'));
- $this->assertNull($table->getBehavior('FakeBehavior'));
}
/**