public function testMain() { $NewLetter = new postman\models\LetterModel(['subject' => uniqid(rand(), true), 'body' => uniqid(rand(), true), 'recipients' => uniqid(rand(), true), 'attachments' => uniqid(rand(), true)]); $this->assertNotEmpty($NewLetter->attributeLabels()); if ($NewLetter->save() === false) { $this->fail('Failed to save the model. Error: ' . $NewLetter->getFirstErrors()[0]); } else { $Letter = postman\models\LetterModel::findOne($NewLetter->id); $this->assertInstanceOf(postman\models\LetterModel::className(), $Letter); $this->assertEquals(1, $NewLetter->delete()); } }