diff --git a/tests/LUIS/Tests/Models/AppTest.php b/tests/LUIS/Tests/Models/AppTest.php new file mode 100644 index 0000000..bae805d --- /dev/null +++ b/tests/LUIS/Tests/Models/AppTest.php @@ -0,0 +1,50 @@ + 'name', + 'description' => 'description', + 'domain' => 'domain', + 'culture' => 'en-us', + 'tokenizerVersion' => '1.0', + 'usageScenario' => 'usage', + 'initialVersionId' => '0.1', + ]); + + $this->assertEquals('name', $app->getName()); + $this->assertEquals('description', $app->getDescription()); + $this->assertEquals('domain', $app->getDomain()); + $this->assertEquals('en-us', $app->getCulture()); + $this->assertEquals('0.1', $app->getInitialVersionId()); + $this->assertEquals('1.0', $app->getTokenizerVersion()); + $this->assertEquals('usage', $app->getUsageScenario()); + } + + public function testSetterGetter() + { + $app = new App(); + + $app->setName('name') + ->setDescription('description') + ->setDomain('domain') + ->setCulture('en-us') + ->setInitialVersionId('0.1') + ->setTokenizerVersion('1.0') + ->setUsageScenario('usage'); + + $this->assertEquals('name', $app->getName()); + $this->assertEquals('description', $app->getDescription()); + $this->assertEquals('domain', $app->getDomain()); + $this->assertEquals('en-us', $app->getCulture()); + $this->assertEquals('0.1', $app->getInitialVersionId()); + $this->assertEquals('1.0', $app->getTokenizerVersion()); + $this->assertEquals('usage', $app->getUsageScenario()); + } +} diff --git a/tests/LUIS/Tests/Models/ModelAbstractTest.php b/tests/LUIS/Tests/Models/ModelAbstractTest.php new file mode 100644 index 0000000..ab4a690 --- /dev/null +++ b/tests/LUIS/Tests/Models/ModelAbstractTest.php @@ -0,0 +1,17 @@ +getMockForAbstractClass(ModelAbstract::class); + + $stub->expects($this->any()) + ->method('toArray') + ->will($this->returnValue([])); + } +} diff --git a/tests/LUIS/Tests/Models/UtteranceTest.php b/tests/LUIS/Tests/Models/UtteranceTest.php new file mode 100644 index 0000000..761696e --- /dev/null +++ b/tests/LUIS/Tests/Models/UtteranceTest.php @@ -0,0 +1,34 @@ + 'text', + 'intentName' => 'intent name', + 'entityLabels' => [], + ]); + + $this->assertEquals('text', $utterance->getText()); + $this->assertEquals('intent name', $utterance->getIntentName()); + $this->assertEquals([], $utterance->getEntityLabels()); + } + + public function testSetterGetter() + { + $utterance = new Utterance(); + + $utterance->setText('text') + ->setIntentName('intent name') + ->setEntityLabels([]); + + $this->assertEquals('text', $utterance->getText()); + $this->assertEquals('intent name', $utterance->getIntentName()); + $this->assertEquals([], $utterance->getEntityLabels()); + } +} diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 0000000..123801a --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,4 @@ +register(true); \ No newline at end of file