fixed problems with unit tests, about their related directories

Esse commit está contido em:
Felipe Nascimento de Moura
2011-02-06 22:24:08 -02:00
commit 8ed05b0134
14 arquivos alterados com 461 adições e 404 exclusões
@@ -1,200 +0,0 @@
<?php
require_once dirname(__FILE__) . '/../../../../../mind3rd/API/interfaces/inflection.php';
require_once dirname(__FILE__) . '/../../../../../mind3rd/API/languages/pt-BR/Inflect.php';
/**
* Test class for Inflect.
* Generated by PHPUnit on 2010-11-06 at 23:55:39.
*/
class InflectTest extends PHPUnit_Framework_TestCase {
/**
* @var Inflect
*/
protected $object;
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function setUp() {
$this->object = new Inflect;
}
/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
protected function tearDown() {
}
public function testisSingular() {
$this->assertTrue(Inflect::isSingular('homem'));
}
public function testisSingular1() {
$this->assertFalse(Inflect::isSingular('homens'));
}
public function testisSingular2() {
$this->assertFalse(Inflect::isSingular('caminhões'));
}
public function testisSingular3() {
$this->assertTrue(Inflect::isSingular('caminhão'));
}
public function testisSingular4() {
$this->assertFalse(Inflect::isSingular('pães'));
}
public function testisSingular5() {
$this->assertTrue(Inflect::isSingular('pão'));
}
public function testisSingular6() {
$this->assertFalse(Inflect::isSingular('carros'));
}
public function testisSingular7() {
$this->assertTrue(Inflect::isSingular('atlas'));
}
public function testisSingular8() {
$this->assertTrue(Inflect::isSingular('professor'));
}
public function testisSingular9() {
$this->assertFalse(Inflect::isSingular('professores'));
}
public function testToPlural() {
$this->assertEquals(Inflect::toPlural('homem'), 'homens');
}
public function testToPlural1() {
$this->assertEquals(Inflect::toPlural('caminhão'), 'caminhões');
}
public function testToPlural2() {
$this->assertEquals(Inflect::toPlural('pão'), 'pães');
}
public function testToPlural3() {
$this->assertEquals(Inflect::toPlural('carro'), 'carros');
}
public function testToPlural4() {
$this->assertEquals(Inflect::toPlural('átlas'), 'átlas');
}
public function testToPlural5() {
$this->assertEquals(Inflect::toPlural('óculos'), 'óculos');
}
public function testToPlural6() {
$this->assertEquals(Inflect::toPlural('peão'), 'peões');
}
public function testToPlural7() {
$this->assertEquals(Inflect::toPlural('aluna'), 'alunas');
}
public function testToSingular() {
$this->assertEquals(Inflect::toSingular('homens'), 'homem');
}
public function testToSingular1() {
$this->assertEquals(Inflect::toSingular('caminhões'), 'caminhão');
}
public function testToSingular2() {
$this->assertEquals(Inflect::toSingular('pães'), 'pão');
}
public function testToSingular3() {
$this->assertEquals(Inflect::toSingular('carros'), 'carro');
}
public function testToSingular4() {
$this->assertEquals(Inflect::toSingular('átlas'), 'átlas');
}
public function testToSingular5() {
$this->assertEquals(Inflect::toSingular('óculos'), 'óculos');
}
public function testToSingular6() {
$this->assertEquals(Inflect::toSingular('peões'), 'peão');
}
public function testToSingular7() {
$this->assertEquals(Inflect::toSingular('alunas'), 'aluna');
}
public function testToSingular8() {
$this->assertEquals(Inflect::toSingular('professores'), 'professor');
}
public function testToFemale() {
$this->assertEquals(Inflect::toFemale('aluno'), 'aluna');
}
public function testToFemale1() {
$this->assertEquals(Inflect::toFemale('réu'), 'ré');
}
public function testToFemale2() {
$this->assertEquals(Inflect::toFemale('gato'), 'gata');
}
public function testToFemale3() {
$this->assertEquals(Inflect::toFemale('leão'), 'leoa');
}
public function testToFemale4() {
$this->assertEquals(Inflect::toFemale('chorão'), 'chorona');
}
public function testToFemale5() {
$this->assertEquals(Inflect::toFemale('mestre'), 'mestra');
}
public function testToFemale6() {
$this->assertEquals(Inflect::toFemale('doutor'), 'doutora');
}
public function testToMale1() {
$this->assertEquals(Inflect::toMale('cada'), 'cada');
}
public function testToMale2() {
$this->assertEquals(Inflect::toMale('aluna'), 'aluno');
}
public function testToMale3() {
$this->assertEquals(Inflect::toMale('ré'), 'réu');
}
public function testToMale4() {
$this->assertEquals(Inflect::toMale('gata'), 'gato');
}
public function testToMale5() {
$this->assertEquals(Inflect::toMale('leoa'), 'leão');
}
public function testToMale6() {
$this->assertEquals(Inflect::toMale('chorona'), 'chorão');
}
public function testToMale7() {
$this->assertEquals(Inflect::toMale('mestra'), 'mestre');
}
public function testToMale8() {
$this->assertEquals(Inflect::toMale('doutora'), 'doutor');
}
public function testToMale9() {
$this->assertEquals(Inflect::toMale('professora'), 'professor');
}
public function testIsFemale() {
$this->assertTrue(Inflect::isFemale('mulher'));
}
public function testIsFemale1() {
$this->assertTrue(Inflect::isFemale('freira'));
}
public function testIsFemale2() {
$this->assertTrue(Inflect::isFemale('casa'));
}
public function testIsFemale3() {
$this->assertTrue(Inflect::isFemale('ré'));
}
public function testIsFemale4() {
$this->assertFalse(Inflect::isFemale('réu'));
}
public function testIsFemale5() {
$this->assertTrue(Inflect::isFemale('amorosa'));
}
public function testIsFemale6() {
$this->assertFalse(Inflect::isFemale('campeão'));
}
public function testIsFemale7() {
$this->assertFalse(Inflect::isFemale('chapél'));
}
public function testIsFemale8() {
$this->assertTrue(Inflect::isFemale('chorona'));
}
public function testIsFemale9() {
$this->assertTrue(Inflect::isFemale('pequenininha'));
}
public function testIsFemale10() {
$this->assertFalse(Inflect::isFemale('professor'));
}
}
?>
@@ -1,178 +0,0 @@
<?php
require_once dirname(__FILE__) . '/../../../../../mind3rd/API/classes/Mind.php';
require_once dirname(__FILE__) . '/../../../../../mind3rd/API/languages/pt-BR/Verbalizer.php';
/**
* Test class for Verbalizer.
* Generated by PHPUnit on 2010-12-17 at 22:16:50.
*/
class VerbalizerTest extends PHPUnit_Framework_TestCase {
/**
* @var Verbalizer
*/
protected $object;
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function setUp() {
$this->object = new Verbalizer;
}
/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
protected function tearDown() {
}
public function testIsVerb() {
$this->assertTrue(Verbalizer::isVerb('correr'));
}
public function testIsVerb1() {
$this->assertTrue(Verbalizer::isVerb('nadar'));
}
public function testIsVerb2() {
$this->assertTrue(Verbalizer::isVerb('nadam'));
}
public function testIsVerb3() {
$this->assertTrue(Verbalizer::isVerb('ministrarão'));
}
public function testIsVerb4() {
$this->assertTrue(Verbalizer::isVerb('apresentar'));
}
public function testIsVerb5() {
$this->assertTrue(Verbalizer::isVerb('coloco'));
}
public function testIsVerb6() {
$this->assertTrue(Verbalizer::isVerb('lemos'));
}
public function testIsVerb7() {
$this->assertTrue(Verbalizer::isVerb('correremos'));
}
public function testIsVerb8() {
$this->assertTrue(Verbalizer::isVerb('ministrarão'));
}
public function testIsVerb9() {
$this->assertTrue(Verbalizer::isVerb('tomamos'));
}
public function testIsVerb10() {
$this->assertTrue(Verbalizer::isVerb('comemos'));
}
public function testIsVerb11() {
$this->assertTrue(Verbalizer::isVerb('beberemos'));
}
public function testIsVerb12() {
$this->assertTrue(Verbalizer::isVerb('tomo'));
}
public function testIsVerb13() {
$this->assertTrue(Verbalizer::isVerb('como'));
}
public function testIsVerb14() {
$this->assertTrue(Verbalizer::isVerb('toma'));
}
public function testIsVerb15() {
$this->assertTrue(Verbalizer::isVerb('coma'));
}
public function testIsVerb17() {
$this->assertTrue(Verbalizer::isVerb('levantaremos'));
}
public function testIsVerb18() {
$this->assertFalse(Verbalizer::isVerb('abajur'));
}
public function testIsVerb19() {
$this->assertFalse(Verbalizer::isVerb('cadeira'));
}
public function testIsVerb20() {
$this->assertFalse(Verbalizer::isVerb('violão'));
}
public function testIsVerb21() {
$this->assertTrue(Verbalizer::isVerb('falhar'));
}
public function testIsVerb22() {
$this->assertTrue(Verbalizer::isVerb('falhei'));
}
public function testIsVerb23() {
$this->assertTrue(Verbalizer::isVerb('falharei'));
}
public function testIsVerb24() {
$this->assertTrue(Verbalizer::isVerb('falhou'));
}
public function testIsVerb25() {
$this->assertTrue(Verbalizer::isVerb('falhamos'));
}
public function testIsVerb26() {
$this->assertTrue(Verbalizer::isVerb('falharei'));
}
public function testIsVerb27() {
$this->assertTrue(Verbalizer::isVerb('falharemos'));
}
public function testIsVerb28() {
$this->assertTrue(Verbalizer::isVerb('correu'));
}
public function testIsVerb29() {
$this->assertTrue(Verbalizer::isVerb('correrás'));
}
public function testIsVerb30() {
$this->assertTrue(Verbalizer::isVerb('falhará'));
}
public function testIsVerb31() {
$this->assertTrue(Verbalizer::isVerb('comeu'));
}
public function testIsVerb32() {
$this->assertFalse(Verbalizer::isVerb('professor'));
}
// testing the toInfinitive method
// NOTICE that its goals is about the present/future words...
// past is not supported
public function testToInfinitive1() {
$this->assertEquals('saber', Verbalizer::toInfinitive('sei'));
}
public function testToInfinitive2() {
$this->assertEquals('poderá', Verbalizer::toInfinitive('poderá'));
}
public function testToInfinitive3() {
$this->assertEquals('amar', Verbalizer::toInfinitive('ama'));
}
public function testToInfinitive4() {
$this->assertEquals('correr', Verbalizer::toInfinitive('corre'));
}
public function testToInfinitive5() {
$this->assertEquals('correr', Verbalizer::toInfinitive('correm'));
}
public function testToInfinitive6() {
$this->assertEquals('lavar', Verbalizer::toInfinitive('lavam'));
}
public function testToInfinitive7() {
$this->assertEquals('ministrar', Verbalizer::toInfinitive('ministram'));
}
public function testToInfinitive8() {
$this->assertEquals('ter', Verbalizer::toInfinitive('terão'));
}
public function testToInfinitive9() {
$this->assertEquals('alimentar', Verbalizer::toInfinitive('alimentarão'));
}
public function testToInfinitive10() {
$this->assertEquals('pôr', Verbalizer::toInfinitive('põe'));
}
public function testToInfinitive11() {
$this->assertEquals('colocar', Verbalizer::toInfinitive('colocarão'));
}
public function testToInfinitive12() {
$this->assertEquals('varrer', Verbalizer::toInfinitive('varrer'));
}
public function testToInfinitive13() {
$this->assertEquals('poder', Verbalizer::toInfinitive('pode'));
}
public function testLoadVerbs() {
}
}
?>
@@ -1,15 +1,15 @@
<?php
require_once dirname(__FILE__) . '/../../../../../mind3rd/API/languages/pt-BR/IgnoreForms.php';
require_once dirname(__FILE__) . '/../../../../../mind3rd/API/languages/pt/IgnoreForms.php';
/**
* Test class for IgnoreForms.
* Test class for pt\IgnoreForms.
* Generated by PHPUnit on 2010-12-19 at 11:23:40.
*/
class IgnoreFormsTest extends PHPUnit_Framework_TestCase {
/**
* @var IgnoreForms
* @var pt\IgnoreForms
*/
protected $object;
@@ -18,7 +18,7 @@ class IgnoreFormsTest extends PHPUnit_Framework_TestCase {
* This method is called before a test is executed.
*/
protected function setUp() {
$this->object = new IgnoreForms;
$this->object = new pt\IgnoreForms;
}
/**
@@ -30,18 +30,18 @@ class IgnoreFormsTest extends PHPUnit_Framework_TestCase {
}
public function testShouldBeIgnored() {
$this->assertTrue(IgnoreForms::shouldBeIgnored('felizmente'));
$this->assertTrue(pt\IgnoreForms::shouldBeIgnored('felizmente'));
}
public function testShouldBeIgnored1() {
$this->assertTrue(IgnoreForms::shouldBeIgnored('provavelmente'));
$this->assertTrue(pt\IgnoreForms::shouldBeIgnored('provavelmente'));
}
public function testShouldBeUsed() {
$this->assertTrue(IgnoreForms::shouldBeUsed('trabalhará'));
$this->assertTrue(pt\IgnoreForms::shouldBeUsed('trabalhará'));
}
public function testShouldBeUsed1() {
$this->assertTrue(IgnoreForms::shouldBeUsed('mente'));
$this->assertTrue(pt\IgnoreForms::shouldBeUsed('mente'));
}
}
@@ -0,0 +1,200 @@
<?php
require_once dirname(__FILE__) . '/../../../../../mind3rd/API/interfaces/inflection.php';
require_once dirname(__FILE__) . '/../../../../../mind3rd/API/languages/pt/Inflect.php';
/**
* Test class for pt\Inflect.
* Generated by PHPUnit on 2010-11-06 at 23:55:39.
*/
class InflectTest extends PHPUnit_Framework_TestCase {
/**
* @var pt\Inflect
*/
protected $object;
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function setUp() {
$this->object = new pt\Inflect;
}
/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
protected function tearDown() {
}
public function testisSingular() {
$this->assertTrue(pt\Inflect::isSingular('homem'));
}
public function testisSingular1() {
$this->assertFalse(pt\Inflect::isSingular('homens'));
}
public function testisSingular2() {
$this->assertFalse(pt\Inflect::isSingular('caminhões'));
}
public function testisSingular3() {
$this->assertTrue(pt\Inflect::isSingular('caminhão'));
}
public function testisSingular4() {
$this->assertFalse(pt\Inflect::isSingular('pães'));
}
public function testisSingular5() {
$this->assertTrue(pt\Inflect::isSingular('pão'));
}
public function testisSingular6() {
$this->assertFalse(pt\Inflect::isSingular('carros'));
}
public function testisSingular7() {
$this->assertTrue(pt\Inflect::isSingular('atlas'));
}
public function testisSingular8() {
$this->assertTrue(pt\Inflect::isSingular('professor'));
}
public function testisSingular9() {
$this->assertFalse(pt\Inflect::isSingular('professores'));
}
public function testToPlural() {
$this->assertEquals(pt\Inflect::toPlural('homem'), 'homens');
}
public function testToPlural1() {
$this->assertEquals(pt\Inflect::toPlural('caminhão'), 'caminhões');
}
public function testToPlural2() {
$this->assertEquals(pt\Inflect::toPlural('pão'), 'pães');
}
public function testToPlural3() {
$this->assertEquals(pt\Inflect::toPlural('carro'), 'carros');
}
public function testToPlural4() {
$this->assertEquals(pt\Inflect::toPlural('átlas'), 'átlas');
}
public function testToPlural5() {
$this->assertEquals(pt\Inflect::toPlural('óculos'), 'óculos');
}
public function testToPlural6() {
$this->assertEquals(pt\Inflect::toPlural('peão'), 'peões');
}
public function testToPlural7() {
$this->assertEquals(pt\Inflect::toPlural('aluna'), 'alunas');
}
public function testToSingular() {
$this->assertEquals(pt\Inflect::toSingular('homens'), 'homem');
}
public function testToSingular1() {
$this->assertEquals(pt\Inflect::toSingular('caminhões'), 'caminhão');
}
public function testToSingular2() {
$this->assertEquals(pt\Inflect::toSingular('pães'), 'pão');
}
public function testToSingular3() {
$this->assertEquals(pt\Inflect::toSingular('carros'), 'carro');
}
public function testToSingular4() {
$this->assertEquals(pt\Inflect::toSingular('átlas'), 'átlas');
}
public function testToSingular5() {
$this->assertEquals(pt\Inflect::toSingular('óculos'), 'óculos');
}
public function testToSingular6() {
$this->assertEquals(pt\Inflect::toSingular('peões'), 'peão');
}
public function testToSingular7() {
$this->assertEquals(pt\Inflect::toSingular('alunas'), 'aluna');
}
public function testToSingular8() {
$this->assertEquals(pt\Inflect::toSingular('professores'), 'professor');
}
public function testToFemale() {
$this->assertEquals(pt\Inflect::toFemale('aluno'), 'aluna');
}
public function testToFemale1() {
$this->assertEquals(pt\Inflect::toFemale('réu'), 'ré');
}
public function testToFemale2() {
$this->assertEquals(pt\Inflect::toFemale('gato'), 'gata');
}
public function testToFemale3() {
$this->assertEquals(pt\Inflect::toFemale('leão'), 'leoa');
}
public function testToFemale4() {
$this->assertEquals(pt\Inflect::toFemale('chorão'), 'chorona');
}
public function testToFemale5() {
$this->assertEquals(pt\Inflect::toFemale('mestre'), 'mestra');
}
public function testToFemale6() {
$this->assertEquals(pt\Inflect::toFemale('doutor'), 'doutora');
}
public function testToMale1() {
$this->assertEquals(pt\Inflect::toMale('cada'), 'cada');
}
public function testToMale2() {
$this->assertEquals(pt\Inflect::toMale('aluna'), 'aluno');
}
public function testToMale3() {
$this->assertEquals(pt\Inflect::toMale('ré'), 'réu');
}
public function testToMale4() {
$this->assertEquals(pt\Inflect::toMale('gata'), 'gato');
}
public function testToMale5() {
$this->assertEquals(pt\Inflect::toMale('leoa'), 'leão');
}
public function testToMale6() {
$this->assertEquals(pt\Inflect::toMale('chorona'), 'chorão');
}
public function testToMale7() {
$this->assertEquals(pt\Inflect::toMale('mestra'), 'mestre');
}
public function testToMale8() {
$this->assertEquals(pt\Inflect::toMale('doutora'), 'doutor');
}
public function testToMale9() {
$this->assertEquals(pt\Inflect::toMale('professora'), 'professor');
}
public function testIsFemale() {
$this->assertTrue(pt\Inflect::isFemale('mulher'));
}
public function testIsFemale1() {
$this->assertTrue(pt\Inflect::isFemale('freira'));
}
public function testIsFemale2() {
$this->assertTrue(pt\Inflect::isFemale('casa'));
}
public function testIsFemale3() {
$this->assertTrue(pt\Inflect::isFemale('ré'));
}
public function testIsFemale4() {
$this->assertFalse(pt\Inflect::isFemale('réu'));
}
public function testIsFemale5() {
$this->assertTrue(pt\Inflect::isFemale('amorosa'));
}
public function testIsFemale6() {
$this->assertFalse(pt\Inflect::isFemale('campeão'));
}
public function testIsFemale7() {
$this->assertFalse(pt\Inflect::isFemale('chapél'));
}
public function testIsFemale8() {
$this->assertTrue(pt\Inflect::isFemale('chorona'));
}
public function testIsFemale9() {
$this->assertTrue(pt\Inflect::isFemale('pequenininha'));
}
public function testIsFemale10() {
$this->assertFalse(pt\Inflect::isFemale('professor'));
}
}
?>
@@ -0,0 +1,178 @@
<?php
require_once dirname(__FILE__) . '/../../../../../mind3rd/API/classes/Mind.php';
require_once dirname(__FILE__) . '/../../../../../mind3rd/API/languages/pt/Verbalizer.php';
/**
* Test class for pt\Verbalizer.
* Generated by PHPUnit on 2010-12-17 at 22:16:50.
*/
class VerbalizerTest extends PHPUnit_Framework_TestCase {
/**
* @var pt\Verbalizer
*/
protected $object;
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function setUp() {
$this->object = new pt\Verbalizer;
}
/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
protected function tearDown() {
}
public function testIsVerb() {
$this->assertTrue(pt\Verbalizer::isVerb('correr'));
}
public function testIsVerb1() {
$this->assertTrue(pt\Verbalizer::isVerb('nadar'));
}
public function testIsVerb2() {
$this->assertTrue(pt\Verbalizer::isVerb('nadam'));
}
public function testIsVerb3() {
$this->assertTrue(pt\Verbalizer::isVerb('ministrarão'));
}
public function testIsVerb4() {
$this->assertTrue(pt\Verbalizer::isVerb('apresentar'));
}
public function testIsVerb5() {
$this->assertTrue(pt\Verbalizer::isVerb('coloco'));
}
public function testIsVerb6() {
$this->assertTrue(pt\Verbalizer::isVerb('lemos'));
}
public function testIsVerb7() {
$this->assertTrue(pt\Verbalizer::isVerb('correremos'));
}
public function testIsVerb8() {
$this->assertTrue(pt\Verbalizer::isVerb('ministrarão'));
}
public function testIsVerb9() {
$this->assertTrue(pt\Verbalizer::isVerb('tomamos'));
}
public function testIsVerb10() {
$this->assertTrue(pt\Verbalizer::isVerb('comemos'));
}
public function testIsVerb11() {
$this->assertTrue(pt\Verbalizer::isVerb('beberemos'));
}
public function testIsVerb12() {
$this->assertTrue(pt\Verbalizer::isVerb('tomo'));
}
public function testIsVerb13() {
$this->assertTrue(pt\Verbalizer::isVerb('como'));
}
public function testIsVerb14() {
$this->assertTrue(pt\Verbalizer::isVerb('toma'));
}
public function testIsVerb15() {
$this->assertTrue(pt\Verbalizer::isVerb('coma'));
}
public function testIsVerb17() {
$this->assertTrue(pt\Verbalizer::isVerb('levantaremos'));
}
public function testIsVerb18() {
$this->assertFalse(pt\Verbalizer::isVerb('abajur'));
}
public function testIsVerb19() {
$this->assertFalse(pt\Verbalizer::isVerb('cadeira'));
}
public function testIsVerb20() {
$this->assertFalse(pt\Verbalizer::isVerb('violão'));
}
public function testIsVerb21() {
$this->assertTrue(pt\Verbalizer::isVerb('falhar'));
}
public function testIsVerb22() {
$this->assertTrue(pt\Verbalizer::isVerb('falhei'));
}
public function testIsVerb23() {
$this->assertTrue(pt\Verbalizer::isVerb('falharei'));
}
public function testIsVerb24() {
$this->assertTrue(pt\Verbalizer::isVerb('falhou'));
}
public function testIsVerb25() {
$this->assertTrue(pt\Verbalizer::isVerb('falhamos'));
}
public function testIsVerb26() {
$this->assertTrue(pt\Verbalizer::isVerb('falharei'));
}
public function testIsVerb27() {
$this->assertTrue(pt\Verbalizer::isVerb('falharemos'));
}
public function testIsVerb28() {
$this->assertTrue(pt\Verbalizer::isVerb('correu'));
}
public function testIsVerb29() {
$this->assertTrue(pt\Verbalizer::isVerb('correrás'));
}
public function testIsVerb30() {
$this->assertTrue(pt\Verbalizer::isVerb('falhará'));
}
public function testIsVerb31() {
$this->assertTrue(pt\Verbalizer::isVerb('comeu'));
}
public function testIsVerb32() {
$this->assertFalse(pt\Verbalizer::isVerb('professor'));
}
// testing the toInfinitive method
// NOTICE that its goals is about the present/future words...
// past is not supported
public function testToInfinitive1() {
$this->assertEquals('saber', pt\Verbalizer::toInfinitive('sei'));
}
public function testToInfinitive2() {
$this->assertEquals('poderá', pt\Verbalizer::toInfinitive('poderá'));
}
public function testToInfinitive3() {
$this->assertEquals('amar', pt\Verbalizer::toInfinitive('ama'));
}
public function testToInfinitive4() {
$this->assertEquals('correr', pt\Verbalizer::toInfinitive('corre'));
}
public function testToInfinitive5() {
$this->assertEquals('correr', pt\Verbalizer::toInfinitive('correm'));
}
public function testToInfinitive6() {
$this->assertEquals('lavar', pt\Verbalizer::toInfinitive('lavam'));
}
public function testToInfinitive7() {
$this->assertEquals('ministrar', pt\Verbalizer::toInfinitive('ministram'));
}
public function testToInfinitive8() {
$this->assertEquals('ter', pt\Verbalizer::toInfinitive('terão'));
}
public function testToInfinitive9() {
$this->assertEquals('alimentar', pt\Verbalizer::toInfinitive('alimentarão'));
}
public function testToInfinitive10() {
$this->assertEquals('pôr', pt\Verbalizer::toInfinitive('põe'));
}
public function testToInfinitive11() {
$this->assertEquals('colocar', pt\Verbalizer::toInfinitive('colocarão'));
}
public function testToInfinitive12() {
$this->assertEquals('varrer', pt\Verbalizer::toInfinitive('varrer'));
}
public function testToInfinitive13() {
$this->assertEquals('poder', pt\Verbalizer::toInfinitive('pode'));
}
public function testLoadVerbs() {
}
}
?>
+17 -1
Ver Arquivo
@@ -89,7 +89,8 @@ class MindCommand extends Symfony\Component\Console\Command\Command
{
foreach(Mind::$pluginList[$this->name][$evt] as $plugin)
{
$plugin->run($this);
if($plugin->active !== false)
$plugin->run($this);
}
}
}
@@ -105,9 +106,14 @@ class MindCommand extends Symfony\Component\Console\Command\Command
public function execute(Console\Input\InputInterface $input,
Console\Output\OutputInterface $output)
{
$this->runPlugins('before');
return $this->verifyCredentials();
}
public function __() {
$this->runPlugins('after');
}
/**
* Calls the program by the HTTP interface
* @method HTTPExecute
@@ -119,6 +125,7 @@ class MindCommand extends Symfony\Component\Console\Command\Command
GLOBAL $_REQ;
if($_REQ['env'] =='http')
{
$this->runPlugins('before');
return $this->verifyCredentials();
}
}
@@ -166,4 +173,13 @@ class MindCommand extends Symfony\Component\Console\Command\Command
// Return the password
return $password;
}
/**
* This method will execute the plugins that should run AFTER
* the execution of the program, so, call parent::runAction AFTER
* each program::runAction command blocks
*/
public function runAction(){
$this->runPlugins('after');
}
}
+4
Ver Arquivo
@@ -8,6 +8,10 @@
{
public $trigger= null;
public $event= 'after';
public $name;
public $version;
public $description;
public $links= Array();
public function setTrigger($trg)
{
+1 -1
Ver Arquivo
@@ -20,7 +20,7 @@ class Analyst {
public static function analize($expression, $structure, $structureKeys){
// let's simply print it as a message, by now
echo implode(' ', $expression).'-'.$structure.'-'.implode('|', $structureKeys)."<br/>\n";
//echo implode(' ', $expression).'-'.$structure.'-'.implode('|', $structureKeys)."<br/>\n";
return true;
}
@@ -164,19 +164,7 @@ class Command
}
else
{
/*
* Changed by Felipe Nascimento <felipenmoura@gmail.com>
*/
if(method_exists($this, 'runPlugins'))
{
$this->runPlugins('before');
$ret= $this->execute($input, $output);
$this->runPlugins('after');
return $ret;
}else
{
$ret= $this->execute($input, $output);
}
$ret= $this->execute($input, $output);
}
}
+16 -2
Ver Arquivo
@@ -3,16 +3,30 @@
* This is an example of plugin you may create
* This plugin simply runs when the program auth is
* called, and shows a message
*
* Notice that plugins set to run AFTER a specific program
* will only execute if the program runs plugins on after
* event
*/
class PluginOne extends MindPlugin implements plugin
{
public $name= "Plugin One";
public $version= "0.1";
public $description = "This is a demo plugin, disabled by default";
public $links= Array();
// change this flag to true and execute the test program
// to see this plugin running
public $active= true;
public function run()
{
echo "EXECUTING THE PLUGIN ONE!!!\n";
}
public function __construct() {
public function __construct()
{
$this->setTrigger('test');
$this->setEvent('after');
$this->setEvent('before');
}
}
+32
Ver Arquivo
@@ -0,0 +1,32 @@
<?php
/*
* This is an example of plugin you may create
* This plugin simply runs when the program auth is
* called, and shows a message
*
* Notice that plugins set to run AFTER a specific program
* will only execute if the program runs plugins on after
* event
*/
class PluginTwo extends MindPlugin implements plugin
{
public $name= "Plugin Two";
public $version= "0.1";
public $description = "This is a demo plugin, disabled by default";
public $links= Array();
// change this flag to true and execute the test program
// to see this plugin running
public $active= true;
public function run()
{
echo "EXECUTING THE PLUGIN TWO!!!\n";
}
public function __construct()
{
$this->setTrigger('test');
$this->setEvent('after');
}
}
+4 -1
Ver Arquivo
@@ -28,9 +28,12 @@ EOT
$this->runStep2();
$this->runStep3();
}
public function runAction()
{
return $this->action();
$ret= $this->action();
parent::runAction();
return $ret;
}
public function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output)