Пример #1
0
 public function testReturnExistingParentContextForSetLocation()
 {
     $builder = $this->getMockBuilder('StoutLogic\\AcfBuilder\\FieldsBuilder')->setConstructorArgs(['parent'])->getMock();
     $middleBuilder = new FieldsBuilder('middle');
     $middleBuilder->setParentContext($builder);
     $subBuilder = new FieldsBuilder('child');
     $subBuilder->setParentContext($middleBuilder);
     $builder->expects($this->exactly(2))->method('setLocation');
     $subBuilder->setLocation('post_type', '==', 'page');
     $middleBuilder->setLocation('post_type', '==', 'page');
 }