1
0
mirror of https://github.com/danog/amp.git synced 2024-12-12 01:19:46 +01:00
amp/test/StructTest.php

53 lines
1.5 KiB
PHP

<?php
namespace Amp\Test;
use Amp\Watcher;
class StructTest extends \PHPUnit_Framework_TestCase {
/**
* @expectedException \DomainException
* @expectedExceptionMessage Amp\Watcher property "callbac" does not exist ... did you mean "callback?"
*/
public function testSetErrorWithSuggestion() {
$struct = new Watcher;
$struct->callbac = function(){};
}
/**
* @expectedException \DomainException
* @expectedExceptionMessage Amp\Watcher property "callbac" does not exist ... did you mean "callback?"
*/
public function testGetErrorWithSuggestion() {
$struct = new Watcher;
$test = $struct->callbac;
}
/**
* @expectedException \DomainException
* @expectedExceptionMessage Amp\Watcher property "callZZZZZZZZZZZ" does not exist
*/
public function testSetErrorWithoutSuggestion() {
$struct = new Watcher;
$struct->callZZZZZZZZZZZ = "test";
}
/**
* @expectedException \DomainException
* @expectedExceptionMessage Amp\Watcher property "callZZZZZZZZZZZ" does not exist
*/
public function testGetErrorWithoutSuggestion() {
$struct = new Watcher;
$test = $struct->callZZZZZZZZZZZ;
}
/**
* @expectedException \DomainException
* @expectedExceptionMessage Amp\Watcher property "__propertySuggestThreshold" does not exist
*/
public function testSuggestionIgnoresPropertyStartingWithUnderscore() {
$struct = new Watcher;
$test = $struct->__propertySuggestThreshold;
}
}