예제 #1
0
 public function getTransport()
 {
     return $this->hasOne(tTransport::className(), ['id' => 'idTransport']);
 }
 public function testCreateTransport()
 {
     //simulate form input
     $post = ['tTransport' => ['TransportIdentifier' => 'AB0202AM23', 'NameMrkCar' => 'KAMAZ', 'model' => '2207', 'volume' => '10000', 'mass' => '4000', 'Note' => 'Truck']];
     $transport = new tTransport();
     $this->assertTrue($transport->load($post), 'Load transport POST data');
     $this->assertTrue($transport->validate(), 'Validate transport');
     $this->assertTrue($transport->save(), 'Create transport');
     return $transport;
 }