2015-05-13 16:05:23 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Amp\Test;
|
|
|
|
|
|
|
|
class StructTest extends \PHPUnit_Framework_TestCase {
|
|
|
|
/**
|
|
|
|
* @expectedException \DomainException
|
2015-07-30 05:23:53 +02:00
|
|
|
* @expectedExceptionMessage Amp\Test\StructTestFixture property "callbac" does not exist ... did you mean "callback?"
|
2015-05-13 16:05:23 +02:00
|
|
|
*/
|
|
|
|
public function testSetErrorWithSuggestion() {
|
2015-07-30 05:23:53 +02:00
|
|
|
$struct = new StructTestFixture;
|
2015-05-13 16:05:23 +02:00
|
|
|
$struct->callbac = function(){};
|
|
|
|
}
|
2015-07-30 05:23:53 +02:00
|
|
|
|
2015-05-13 16:05:23 +02:00
|
|
|
/**
|
|
|
|
* @expectedException \DomainException
|
2015-07-30 05:23:53 +02:00
|
|
|
* @expectedExceptionMessage Amp\Test\StructTestFixture property "callbac" does not exist ... did you mean "callback?"
|
2015-05-13 16:05:23 +02:00
|
|
|
*/
|
|
|
|
public function testGetErrorWithSuggestion() {
|
2015-07-30 05:23:53 +02:00
|
|
|
$struct = new StructTestFixture;
|
2015-05-13 16:05:23 +02:00
|
|
|
$test = $struct->callbac;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @expectedException \DomainException
|
2015-07-30 05:23:53 +02:00
|
|
|
* @expectedExceptionMessage Amp\Test\StructTestFixture property "callZZZZZZZZZZZ" does not exist
|
2015-05-13 16:05:23 +02:00
|
|
|
*/
|
|
|
|
public function testSetErrorWithoutSuggestion() {
|
2015-07-30 05:23:53 +02:00
|
|
|
$struct = new StructTestFixture;
|
2015-05-13 16:05:23 +02:00
|
|
|
$struct->callZZZZZZZZZZZ = "test";
|
|
|
|
}
|
2015-07-30 05:23:53 +02:00
|
|
|
|
2015-05-13 16:05:23 +02:00
|
|
|
/**
|
|
|
|
* @expectedException \DomainException
|
2015-07-30 05:23:53 +02:00
|
|
|
* @expectedExceptionMessage Amp\Test\StructTestFixture property "callZZZZZZZZZZZ" does not exist
|
2015-05-13 16:05:23 +02:00
|
|
|
*/
|
|
|
|
public function testGetErrorWithoutSuggestion() {
|
2015-07-30 05:23:53 +02:00
|
|
|
$struct = new StructTestFixture;
|
2015-05-13 16:05:23 +02:00
|
|
|
$test = $struct->callZZZZZZZZZZZ;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @expectedException \DomainException
|
2015-07-30 05:23:53 +02:00
|
|
|
* @expectedExceptionMessage Amp\Test\StructTestFixture property "__propertySuggestThreshold" does not exist
|
2015-05-13 16:05:23 +02:00
|
|
|
*/
|
|
|
|
public function testSuggestionIgnoresPropertyStartingWithUnderscore() {
|
2015-07-30 05:23:53 +02:00
|
|
|
$struct = new StructTestFixture;
|
2015-05-13 16:05:23 +02:00
|
|
|
$test = $struct->__propertySuggestThreshold;
|
|
|
|
}
|
|
|
|
}
|