Esempio n. 1
0
 public function testConstructEmpty()
 {
     $dummy = Stub::constructEmpty('DummyClass', array('checkMe' => 'checked!'));
     $this->assertNull($dummy->getCheckMe());
 }
Esempio n. 2
0
 /**
  * @dataProvider matcherProvider
  */
 public function testMethodMatcherWithConstructEmpty($count, $matcher)
 {
     $dummy = Stub::constructEmpty('DummyClass', array(), array('goodByeWorld' => $matcher), $this);
     $this->repeatCall($count, array($dummy, 'goodByeWorld'));
 }
Esempio n. 3
0
 public function testStubsFromObject()
 {
     $dummy = Stub::make(new \DummyClass());
     $this->assertTrue(isset($dummy->__mocked));
     $dummy = Stub::makeEmpty(new \DummyClass());
     $this->assertTrue(isset($dummy->__mocked));
     $dummy = Stub::makeEmptyExcept(new \DummyClass(), 'helloWorld');
     $this->assertTrue(isset($dummy->__mocked));
     $dummy = Stub::construct(new \DummyClass());
     $this->assertTrue(isset($dummy->__mocked));
     $dummy = Stub::constructEmpty(new \DummyClass());
     $this->assertTrue(isset($dummy->__mocked));
     $dummy = Stub::constructEmptyExcept(new \DummyClass(), 'helloWorld');
     $this->assertTrue(isset($dummy->__mocked));
 }