Best Atoum code snippet using engine
gin.go
Source:gin.go
...103// - UseRawPath: false104// - UnescapePathValues: true105func New() *Engine {106 debugPrintWARNINGNew()107 engine := &Engine{108 RouterGroup: RouterGroup{109 Handlers: nil,110 basePath: "/",111 root: true,112 },113 FuncMap: template.FuncMap{},114 RedirectTrailingSlash: true,115 RedirectFixedPath: false,116 HandleMethodNotAllowed: false,117 ForwardedByClientIP: true,118 AppEngine: defaultAppEngine,119 UseRawPath: false,120 RemoveExtraSlash: false,121 UnescapePathValues: true,122 MaxMultipartMemory: defaultMultipartMemory,123 trees: make(methodTrees, 0, 9),124 delims: render.Delims{Left: "{{", Right: "}}"},125 secureJsonPrefix: "while(1);",126 }127 engine.RouterGroup.engine = engine128 engine.pool.New = func() interface{} {129 return engine.allocateContext()130 }131 return engine132}133// Default returns an Engine instance with the Logger and Recovery middleware already attached.134func Default() *Engine {135 debugPrintWARNINGDefault()136 engine := New()137 engine.Use(Logger(), Recovery())138 return engine139}140func (engine *Engine) allocateContext() *Context {141 return &Context{engine: engine}142}143// Delims sets template left and right delims and returns a Engine instance.144func (engine *Engine) Delims(left, right string) *Engine {145 engine.delims = render.Delims{Left: left, Right: right}146 return engine147}148// SecureJsonPrefix sets the secureJsonPrefix used in Context.SecureJSON.149func (engine *Engine) SecureJsonPrefix(prefix string) *Engine {150 engine.secureJsonPrefix = prefix151 return engine152}153// LoadHTMLGlob loads HTML files identified by glob pattern154// and associates the result with HTML renderer.155func (engine *Engine) LoadHTMLGlob(pattern string) {156 left := engine.delims.Left157 right := engine.delims.Right158 templ := template.Must(template.New("").Delims(left, right).Funcs(engine.FuncMap).ParseGlob(pattern))159 if IsDebugging() {160 debugPrintLoadTemplate(templ)161 engine.HTMLRender = render.HTMLDebug{Glob: pattern, FuncMap: engine.FuncMap, Delims: engine.delims}162 return163 }164 engine.SetHTMLTemplate(templ)165}166// LoadHTMLFiles loads a slice of HTML files167// and associates the result with HTML renderer.168func (engine *Engine) LoadHTMLFiles(files ...string) {169 if IsDebugging() {170 engine.HTMLRender = render.HTMLDebug{Files: files, FuncMap: engine.FuncMap, Delims: engine.delims}171 return172 }173 templ := template.Must(template.New("").Delims(engine.delims.Left, engine.delims.Right).Funcs(engine.FuncMap).ParseFiles(files...))174 engine.SetHTMLTemplate(templ)175}176// SetHTMLTemplate associate a template with HTML renderer.177func (engine *Engine) SetHTMLTemplate(templ *template.Template) {178 if len(engine.trees) > 0 {179 debugPrintWARNINGSetHTMLTemplate()180 }181 engine.HTMLRender = render.HTMLProduction{Template: templ.Funcs(engine.FuncMap)}182}183// SetFuncMap sets the FuncMap used for template.FuncMap.184func (engine *Engine) SetFuncMap(funcMap template.FuncMap) {185 engine.FuncMap = funcMap186}187// NoRoute adds handlers for NoRoute. It return a 404 code by default.188func (engine *Engine) NoRoute(handlers ...HandlerFunc) {189 engine.noRoute = handlers190 engine.rebuild404Handlers()191}192// NoMethod sets the handlers called when... TODO.193func (engine *Engine) NoMethod(handlers ...HandlerFunc) {194 engine.noMethod = handlers195 engine.rebuild405Handlers()196}197// Use attaches a global middleware to the router. ie. the middleware attached though Use() will be198// included in the handlers chain for every single request. Even 404, 405, static files...199// For example, this is the right place for a logger or error management middleware.200func (engine *Engine) Use(middleware ...HandlerFunc) IRoutes {201 engine.RouterGroup.Use(middleware...)202 engine.rebuild404Handlers()203 engine.rebuild405Handlers()204 return engine205}206func (engine *Engine) rebuild404Handlers() {207 engine.allNoRoute = engine.combineHandlers(engine.noRoute)208}209func (engine *Engine) rebuild405Handlers() {210 engine.allNoMethod = engine.combineHandlers(engine.noMethod)211}212func (engine *Engine) addRoute(method, path string, handlers HandlersChain) {213 assert1(path[0] == '/', "path must begin with '/'")214 assert1(method != "", "HTTP method can not be empty")215 assert1(len(handlers) > 0, "there must be at least one handler")216 debugPrintRoute(method, path, handlers)217 root := engine.trees.get(method)218 if root == nil {219 root = new(node)220 root.fullPath = "/"221 engine.trees = append(engine.trees, methodTree{method: method, root: root})222 }223 root.addRoute(path, handlers)224}225// Routes returns a slice of registered routes, including some useful information, such as:226// the http method, path and the handler name.227func (engine *Engine) Routes() (routes RoutesInfo) {228 for _, tree := range engine.trees {229 routes = iterate("", tree.method, routes, tree.root)230 }231 return routes232}233func iterate(path, method string, routes RoutesInfo, root *node) RoutesInfo {234 path += root.path235 if len(root.handlers) > 0 {236 handlerFunc := root.handlers.Last()237 routes = append(routes, RouteInfo{238 Method: method,239 Path: path,240 Handler: nameOfFunction(handlerFunc),241 HandlerFunc: handlerFunc,242 })243 }244 for _, child := range root.children {245 routes = iterate(path, method, routes, child)246 }247 return routes248}249// Run attaches the router to a http.Server and starts listening and serving HTTP requests.250// It is a shortcut for http.ListenAndServe(addr, router)251// Note: this method will block the calling goroutine indefinitely unless an error happens.252func (engine *Engine) Run(addr ...string) (err error) {253 defer func() { debugPrintError(err) }()254 address := resolveAddress(addr)255 debugPrint("Listening and serving HTTP on %s\n", address)256 err = http.ListenAndServe(address, engine)257 return258}259// RunTLS attaches the router to a http.Server and starts listening and serving HTTPS (secure) requests.260// It is a shortcut for http.ListenAndServeTLS(addr, certFile, keyFile, router)261// Note: this method will block the calling goroutine indefinitely unless an error happens.262func (engine *Engine) RunTLS(addr, certFile, keyFile string) (err error) {263 debugPrint("Listening and serving HTTPS on %s\n", addr)264 defer func() { debugPrintError(err) }()265 err = http.ListenAndServeTLS(addr, certFile, keyFile, engine)266 return267}268// RunUnix attaches the router to a http.Server and starts listening and serving HTTP requests269// through the specified unix socket (ie. a file).270// Note: this method will block the calling goroutine indefinitely unless an error happens.271func (engine *Engine) RunUnix(file string) (err error) {272 debugPrint("Listening and serving HTTP on unix:/%s", file)273 defer func() { debugPrintError(err) }()274 listener, err := net.Listen("unix", file)275 if err != nil {276 return277 }278 defer listener.Close()279 defer os.Remove(file)280 err = http.Serve(listener, engine)281 return282}283// RunFd attaches the router to a http.Server and starts listening and serving HTTP requests284// through the specified file descriptor.285// Note: this method will block the calling goroutine indefinitely unless an error happens.286func (engine *Engine) RunFd(fd int) (err error) {287 debugPrint("Listening and serving HTTP on fd@%d", fd)288 defer func() { debugPrintError(err) }()289 f := os.NewFile(uintptr(fd), fmt.Sprintf("fd@%d", fd))290 listener, err := net.FileListener(f)291 if err != nil {292 return293 }294 defer listener.Close()295 err = engine.RunListener(listener)296 return297}298// RunListener attaches the router to a http.Server and starts listening and serving HTTP requests299// through the specified net.Listener300func (engine *Engine) RunListener(listener net.Listener) (err error) {301 debugPrint("Listening and serving HTTP on listener what's bind with address@%s", listener.Addr())302 defer func() { debugPrintError(err) }()303 err = http.Serve(listener, engine)304 return305}306// ServeHTTP conforms to the http.Handler interface.307func (engine *Engine) ServeHTTP(w http.ResponseWriter, req *http.Request) {308 c := engine.pool.Get().(*Context)309 c.writermem.reset(w)310 c.Request = req311 c.reset()312 engine.handleHTTPRequest(c)313 engine.pool.Put(c)314}315// HandleContext re-enter a context that has been rewritten.316// This can be done by setting c.Request.URL.Path to your new target.317// Disclaimer: You can loop yourself to death with this, use wisely.318func (engine *Engine) HandleContext(c *Context) {319 oldIndexValue := c.index320 c.reset()321 engine.handleHTTPRequest(c)322 c.index = oldIndexValue323}324func (engine *Engine) handleHTTPRequest(c *Context) {325 httpMethod := c.Request.Method326 rPath := c.Request.URL.Path327 unescape := false328 if engine.UseRawPath && len(c.Request.URL.RawPath) > 0 {329 rPath = c.Request.URL.RawPath330 unescape = engine.UnescapePathValues331 }332 if engine.RemoveExtraSlash {333 rPath = cleanPath(rPath)334 }335 // Find root of the tree for the given HTTP method336 t := engine.trees337 for i, tl := 0, len(t); i < tl; i++ {338 if t[i].method != httpMethod {339 continue340 }341 root := t[i].root342 // Find route in tree343 value := root.getValue(rPath, c.Params, unescape)344 if value.handlers != nil {345 c.handlers = value.handlers346 c.Params = value.params347 c.fullPath = value.fullPath348 c.Next()349 c.writermem.WriteHeaderNow()350 return351 }352 if httpMethod != "CONNECT" && rPath != "/" {353 if value.tsr && engine.RedirectTrailingSlash {354 redirectTrailingSlash(c)355 return356 }357 if engine.RedirectFixedPath && redirectFixedPath(c, root, engine.RedirectFixedPath) {358 return359 }360 }361 break362 }363 if engine.HandleMethodNotAllowed {364 for _, tree := range engine.trees {365 if tree.method == httpMethod {366 continue367 }368 if value := tree.root.getValue(rPath, nil, unescape); value.handlers != nil {369 c.handlers = engine.allNoMethod370 serveError(c, http.StatusMethodNotAllowed, default405Body)371 return372 }373 }374 }375 c.handlers = engine.allNoRoute376 serveError(c, http.StatusNotFound, default404Body)377}378var mimePlain = []string{MIMEPlain}379func serveError(c *Context, code int, defaultMessage []byte) {380 c.writermem.status = code381 c.Next()382 if c.writermem.Written() {383 return384 }385 if c.writermem.Status() == code {386 c.writermem.Header()["Content-Type"] = mimePlain387 _, err := c.Writer.Write(defaultMessage)388 if err != nil {389 debugPrint("cannot write message to writer during serve error: %v", err)...
pull.go
Source:pull.go
...37// The PullEngine expects to be invoked with38// OnHello, OnDigest, OnReq, OnRes when the respective message arrives39// from a remote PullEngine40type PullAdapter interface {41 // SelectPeers returns a slice of peers which the engine will initiate the protocol with42 SelectPeers() []string43 // Hello sends a hello message to initiate the protocol44 // and returns an NONCE that is expected to be returned45 // in the digest message.46 Hello(dest string, nonce uint64)47 // SendDigest sends a digest to a remote PullEngine.48 // The context parameter specifies the remote engine to send to.49 SendDigest(digest []string, nonce uint64, context interface{})50 // SendReq sends an array of items to a certain remote PullEngine identified51 // by a string52 SendReq(dest string, items []string, nonce uint64)53 // SendRes sends an array of items to a remote PullEngine identified by a context.54 SendRes(items []string, context interface{}, nonce uint64)55}56// PullEngine is the component that actually invokes the pull algorithm57// with the help of the PullAdapter58type PullEngine struct {59 PullAdapter60 stopFlag int3261 state *util.Set62 item2owners map[string][]string63 peers2nonces map[string]uint6464 nonces2peers map[uint64]string65 acceptingDigests int3266 acceptingResponses int3267 lock sync.Mutex68 outgoingNONCES *util.Set69 incomingNONCES *util.Set70 digFilter DigestFilter71 digestWaitTime time.Duration72 requestWaitTime time.Duration73 responseWaitTime time.Duration74}75// PullEngineConfig is the configuration required to initialize a new pull engine76type PullEngineConfig struct {77 DigestWaitTime time.Duration78 RequestWaitTime time.Duration79 ResponseWaitTime time.Duration80}81// NewPullEngineWithFilter creates an instance of a PullEngine with a certain sleep time82// between pull initiations, and uses the given filters when sending digests and responses83func NewPullEngineWithFilter(participant PullAdapter, sleepTime time.Duration, df DigestFilter,84 config PullEngineConfig) *PullEngine {85 engine := &PullEngine{86 PullAdapter: participant,87 stopFlag: int32(0),88 state: util.NewSet(),89 item2owners: make(map[string][]string),90 peers2nonces: make(map[string]uint64),91 nonces2peers: make(map[uint64]string),92 acceptingDigests: int32(0),93 acceptingResponses: int32(0),94 incomingNONCES: util.NewSet(),95 outgoingNONCES: util.NewSet(),96 digFilter: df,97 digestWaitTime: config.DigestWaitTime,98 requestWaitTime: config.RequestWaitTime,99 responseWaitTime: config.ResponseWaitTime,100 }101 go func() {102 for !engine.toDie() {103 time.Sleep(sleepTime)104 if engine.toDie() {105 return106 }107 engine.initiatePull()108 }109 }()110 return engine111}112// NewPullEngine creates an instance of a PullEngine with a certain sleep time113// between pull initiations114func NewPullEngine(participant PullAdapter, sleepTime time.Duration, config PullEngineConfig) *PullEngine {115 acceptAllFilter := func(_ interface{}) func(string) bool {116 return func(_ string) bool {117 return true118 }119 }120 return NewPullEngineWithFilter(participant, sleepTime, acceptAllFilter, config)121}122func (engine *PullEngine) toDie() bool {123 return atomic.LoadInt32(&(engine.stopFlag)) == int32(1)124}125func (engine *PullEngine) acceptResponses() {126 atomic.StoreInt32(&(engine.acceptingResponses), int32(1))127}128func (engine *PullEngine) isAcceptingResponses() bool {129 return atomic.LoadInt32(&(engine.acceptingResponses)) == int32(1)130}131func (engine *PullEngine) acceptDigests() {132 atomic.StoreInt32(&(engine.acceptingDigests), int32(1))133}134func (engine *PullEngine) isAcceptingDigests() bool {135 return atomic.LoadInt32(&(engine.acceptingDigests)) == int32(1)136}137func (engine *PullEngine) ignoreDigests() {138 atomic.StoreInt32(&(engine.acceptingDigests), int32(0))139}140// Stop stops the engine141func (engine *PullEngine) Stop() {142 atomic.StoreInt32(&(engine.stopFlag), int32(1))143}144func (engine *PullEngine) initiatePull() {145 engine.lock.Lock()146 defer engine.lock.Unlock()147 engine.acceptDigests()148 for _, peer := range engine.SelectPeers() {149 nonce := engine.newNONCE()150 engine.outgoingNONCES.Add(nonce)151 engine.nonces2peers[nonce] = peer152 engine.peers2nonces[peer] = nonce153 engine.Hello(peer, nonce)154 }155 time.AfterFunc(engine.digestWaitTime, func() {156 engine.processIncomingDigests()157 })158}159func (engine *PullEngine) processIncomingDigests() {160 engine.ignoreDigests()161 engine.lock.Lock()162 defer engine.lock.Unlock()163 requestMapping := make(map[string][]string)164 for n, sources := range engine.item2owners {165 // select a random source166 source := sources[util.RandomInt(len(sources))]167 if _, exists := requestMapping[source]; !exists {168 requestMapping[source] = make([]string, 0)169 }170 // append the number to that source171 requestMapping[source] = append(requestMapping[source], n)172 }173 engine.acceptResponses()174 for dest, seqsToReq := range requestMapping {175 engine.SendReq(dest, seqsToReq, engine.peers2nonces[dest])176 }177 time.AfterFunc(engine.responseWaitTime, engine.endPull)178}179func (engine *PullEngine) endPull() {180 engine.lock.Lock()181 defer engine.lock.Unlock()182 atomic.StoreInt32(&(engine.acceptingResponses), int32(0))183 engine.outgoingNONCES.Clear()184 engine.item2owners = make(map[string][]string)185 engine.peers2nonces = make(map[string]uint64)186 engine.nonces2peers = make(map[uint64]string)187}188// OnDigest notifies the engine that a digest has arrived189func (engine *PullEngine) OnDigest(digest []string, nonce uint64, context interface{}) {190 if !engine.isAcceptingDigests() || !engine.outgoingNONCES.Exists(nonce) {191 return192 }193 engine.lock.Lock()194 defer engine.lock.Unlock()195 for _, n := range digest {196 if engine.state.Exists(n) {197 continue198 }199 if _, exists := engine.item2owners[n]; !exists {200 engine.item2owners[n] = make([]string, 0)201 }202 engine.item2owners[n] = append(engine.item2owners[n], engine.nonces2peers[nonce])203 }204}205// Add adds items to the state206func (engine *PullEngine) Add(seqs ...string) {207 for _, seq := range seqs {208 engine.state.Add(seq)209 }210}211// Remove removes items from the state212func (engine *PullEngine) Remove(seqs ...string) {213 for _, seq := range seqs {214 engine.state.Remove(seq)215 }216}217// OnHello notifies the engine a hello has arrived218func (engine *PullEngine) OnHello(nonce uint64, context interface{}) {219 engine.incomingNONCES.Add(nonce)220 time.AfterFunc(engine.requestWaitTime, func() {221 engine.incomingNONCES.Remove(nonce)222 })223 a := engine.state.ToArray()224 var digest []string225 filter := engine.digFilter(context)226 for _, item := range a {227 dig := item.(string)228 if !filter(dig) {229 continue230 }231 digest = append(digest, dig)232 }233 if len(digest) == 0 {234 return235 }236 engine.SendDigest(digest, nonce, context)237}238// OnReq notifies the engine a request has arrived239func (engine *PullEngine) OnReq(items []string, nonce uint64, context interface{}) {240 if !engine.incomingNONCES.Exists(nonce) {241 return242 }243 engine.lock.Lock()244 defer engine.lock.Unlock()245 filter := engine.digFilter(context)246 var items2Send []string247 for _, item := range items {248 if engine.state.Exists(item) && filter(item) {249 items2Send = append(items2Send, item)250 }251 }252 if len(items2Send) == 0 {253 return254 }255 go engine.SendRes(items2Send, context, nonce)256}257// OnRes notifies the engine a response has arrived258func (engine *PullEngine) OnRes(items []string, nonce uint64) {259 if !engine.outgoingNONCES.Exists(nonce) || !engine.isAcceptingResponses() {260 return261 }262 engine.Add(items...)263}264func (engine *PullEngine) newNONCE() uint64 {265 n := uint64(0)266 for {267 n = util.RandomUInt64()268 if !engine.outgoingNONCES.Exists(n) {269 return n270 }271 }272}...
DelegatingEngineTest.php
Source:DelegatingEngineTest.php
...26 $this->assertSame('<html />', $result);27 }28 /**29 * @expectedException \RuntimeException30 * @expectedExceptionMessage No engine is able to work with the template "template.php"31 */32 public function testRenderWithNoSupportedEngine()33 {34 $firstEngine = $this->getEngineMock('template.php', false);35 $secondEngine = $this->getEngineMock('template.php', false);36 $delegatingEngine = new DelegatingEngine(array($firstEngine, $secondEngine));37 $delegatingEngine->render('template.php', array('foo' => 'bar'));38 }39 public function testStreamDelegatesToSupportedEngine()40 {41 $streamingEngine = $this->getStreamingEngineMock('template.php', true);42 $streamingEngine->expects($this->once())43 ->method('stream')44 ->with('template.php', array('foo' => 'bar'))45 ->will($this->returnValue('<html />'));46 $delegatingEngine = new DelegatingEngine(array($streamingEngine));47 $result = $delegatingEngine->stream('template.php', array('foo' => 'bar'));48 $this->assertNull($result);49 }50 /**51 * @expectedException \LogicException52 * @expectedExceptionMessage Template "template.php" cannot be streamed as the engine supporting it does not implement StreamingEngineInterface53 */54 public function testStreamRequiresStreamingEngine()55 {56 $engine = $this->getEngineMock('template.php', true);57 $engine->expects($this->never())->method('stream');58 $delegatingEngine = new DelegatingEngine(array($engine));59 $delegatingEngine->stream('template.php', array('foo' => 'bar'));60 }61 public function testExists()62 {63 $engine = $this->getEngineMock('template.php', true);64 $engine->expects($this->once())65 ->method('exists')66 ->with('template.php')67 ->will($this->returnValue(true));68 $delegatingEngine = new DelegatingEngine(array($engine));69 $this->assertTrue($delegatingEngine->exists('template.php'));70 }71 public function testSupports()72 {73 $engine = $this->getEngineMock('template.php', true);74 $delegatingEngine = new DelegatingEngine(array($engine));75 $this->assertTrue($delegatingEngine->supports('template.php'));76 }77 public function testSupportsWithNoSupportedEngine()78 {79 $engine = $this->getEngineMock('template.php', false);80 $delegatingEngine = new DelegatingEngine(array($engine));81 $this->assertFalse($delegatingEngine->supports('template.php'));82 }83 public function testGetExistingEngine()84 {85 $firstEngine = $this->getEngineMock('template.php', false);86 $secondEngine = $this->getEngineMock('template.php', true);87 $delegatingEngine = new DelegatingEngine(array($firstEngine, $secondEngine));88 $this->assertSame($secondEngine, $delegatingEngine->getEngine('template.php'));89 }90 /**91 * @expectedException \RuntimeException92 * @expectedExceptionMessage No engine is able to work with the template "template.php"93 */94 public function testGetInvalidEngine()95 {96 $firstEngine = $this->getEngineMock('template.php', false);97 $secondEngine = $this->getEngineMock('template.php', false);98 $delegatingEngine = new DelegatingEngine(array($firstEngine, $secondEngine));99 $delegatingEngine->getEngine('template.php', array('foo' => 'bar'));100 }101 private function getEngineMock($template, $supports)102 {103 $engine = $this->getMock('Symfony\Component\Templating\EngineInterface');104 $engine->expects($this->once())105 ->method('supports')106 ->with($template)107 ->will($this->returnValue($supports));108 return $engine;109 }110 private function getStreamingEngineMock($template, $supports)111 {112 $engine = $this->getMockForAbstractClass('Symfony\Component\Templating\Tests\MyStreamingEngine');113 $engine->expects($this->once())114 ->method('supports')115 ->with($template)116 ->will($this->returnValue($supports));117 return $engine;118 }119}120interface MyStreamingEngine extends StreamingEngineInterface, EngineInterface121{122}...
engine
Using AI Code Generation
1require_once 'atoum/classes/autoloader.php';2atoum\autoloader::get()3 ->addDirectory(__DIR__ . '/atoum/classes')4 ->addDirectory(__DIR__ . '/atoum/classes/engines')5;6require_once 'atoum/classes/autoloader.php';7atoum\autoloader::get()8 ->addDirectory(__DIR__ . '/atoum/classes')9 ->addDirectory(__DIR__ . '/atoum/classes/engines')10;11require_once 'atoum/classes/autoloader.php';12atoum\autoloader::get()13 ->addDirectory(__DIR__ . '/atoum/classes')14 ->addDirectory(__DIR__ . '/atoum/classes/engines')15;16require_once 'atoum/classes/autoloader.php';17atoum\autoloader::get()18 ->addDirectory(__DIR__ . '/atoum/classes')19 ->addDirectory(__DIR__ . '/atoum/classes/engines')20;21require_once 'atoum/classes/autoloader.php';22atoum\autoloader::get()23 ->addDirectory(__DIR__ . '/atoum/classes')24 ->addDirectory(__DIR__ . '/atoum/classes/engines')25;26require_once 'atoum/classes/autoloader.php';27atoum\autoloader::get()28 ->addDirectory(__DIR__ . '/atoum/classes')29 ->addDirectory(__DIR__ . '/atoum/classes/engines')30;31require_once 'atoum/classes/autoloader.php';32atoum\autoloader::get()33 ->addDirectory(__DIR__ . '/atoum/classes')34 ->addDirectory(__DIR__ . '/atoum/classes/engines')35;
engine
Using AI Code Generation
1require_once 'atoum.php';2require_once 'phpunit.php';3require_once 'simpletest.php';4require_once 'qunit.php';5require_once 'phpspec.php';6require_once 'phpspec2.php';7require_once 'phpspec3.php';8require_once 'phpspec4.php';9require_once 'phpspec5.php';10require_once 'phpspec6.php';11require_once 'phpspec7.php';12require_once 'phpspec8.php';13require_once 'phpspec9.php';14require_once 'phpspec10.php';15require_once 'phpspec11.php';16require_once 'phpspec12.php';17require_once 'phpspec13.php';18require_once 'phpspec14.php';19require_once 'phpspec15.php';20require_once 'phpspec16.php';21require_once 'phpspec17.php';22require_once 'phpspec18.php';23require_once 'phpspec19.php';24require_once 'phpspec20.php';25require_once 'phpspec21.php';26require_once 'phpspec22.php';27require_once 'phpspec23.php';
engine
Using AI Code Generation
1use \mageekguy\atoum;2{3 public function testMyFunction()4 {5 ->if($myClass = new \MyClass())6 ->object($myClass->myFunction())7 ->isEqualTo('myString')8 ;9 }10}11{12 public function myFunction()13 {14 return 'myString';15 }16}
engine
Using AI Code Generation
1require_once 'engine.class.php';2$engine = new Engine();3$engine->start();4require_once 'engine.class.php';5$engine = new Engine();6$engine->start();
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Trigger Selenium automation tests on a cloud-based Grid of 3000+ real browsers and operating systems.
Test now for FreeGet 100 minutes of automation test minutes FREE!!