/** * Tests the default relationship information provided by the backend data source. * * @return void */ public function testDefaultRelationshipInfo() { $connection = $this->_connection; $message = "Relationships are not supported by this adapter."; $this->skipIf(!$connection::enabled('relationships'), $message); $this->assertEqual(array('Employeess'), array_keys(Companies::relations())); $this->assertEqual(array('Companies'), array_keys(Employees::relations())); $this->assertEqual(array('Employeess'), Companies::relations('hasMany')); $this->assertEqual(array('Companies'), Employees::relations('belongsTo')); $this->assertFalse(Companies::relations('belongsTo')); $this->assertFalse(Companies::relations('hasOne')); $this->assertFalse(Employees::relations('hasMany')); $this->assertFalse(Employees::relations('hasOne')); $result = Companies::relations('Employeess'); $this->assertEqual('hasMany', $result->data('type')); $this->assertEqual($this->_classes['employees'], $result->data('to')); }