@@ -374,3 +374,193 @@ Feature: Manage WordPress transient cache
374
374
"""
375
375
bar6
376
376
"""
377
+
378
+ Scenario : List transients on single site
379
+ Given a WP install
380
+ And I run `wp transient set foo bar`
381
+ And I run `wp transient set foo2 bar2 610`
382
+ And I run `wp option update _transient_timeout_foo2 95649119999`
383
+ And I run `wp transient set foo3 bar3 300`
384
+ And I run `wp option update _transient_timeout_foo3 1321009871`
385
+ And I run `wp transient set foo4 bar4 --network`
386
+ And I run `wp transient set foo5 bar5 610 --network`
387
+ And I run `wp option update _site_transient_timeout_foo5 95649119999`
388
+ And I run `wp transient set foo6 bar6 300 --network`
389
+ And I run `wp option update _site_transient_timeout_foo6 1321009871`
390
+
391
+ When I run `wp transient list --format=csv`
392
+ Then STDOUT should be:
393
+ """
394
+ name,value,expiration
395
+ foo,bar,false
396
+ foo2,bar2,95649119999
397
+ foo3,bar3,1321009871
398
+ """
399
+
400
+ When I run `wp transient list --format=csv --human-readable`
401
+ Then STDOUT should contain:
402
+ """
403
+ foo,bar,"never expires"
404
+ """
405
+ And STDOUT should contain:
406
+ """
407
+ foo3,bar3,expired
408
+ """
409
+ And STDOUT should not contain:
410
+ """
411
+ foo2,bar2,95649119999
412
+ """
413
+
414
+ When I run `wp transient list --network --format=csv`
415
+ Then STDOUT should be:
416
+ """
417
+ name,value,expiration
418
+ foo4,bar4,false
419
+ foo5,bar5,95649119999
420
+ foo6,bar6,1321009871
421
+ """
422
+
423
+ Scenario : List transients on multisite
424
+ Given a WP multisite install
425
+ And I run `wp transient set foo bar`
426
+ And I run `wp transient set foo2 bar2 610`
427
+ And I run `wp option update _transient_timeout_foo2 95649119999`
428
+ And I run `wp transient set foo3 bar3 300`
429
+ And I run `wp option update _transient_timeout_foo3 1321009871`
430
+ And I run `wp transient set foo4 bar4 --network`
431
+ And I run `wp transient set foo5 bar5 610 --network`
432
+ And I run `wp site option update _site_transient_timeout_foo5 95649119999`
433
+ And I run `wp transient set foo6 bar6 300 --network`
434
+ And I run `wp site option update _site_transient_timeout_foo6 1321009871`
435
+
436
+ When I run `wp transient list --format=csv`
437
+ Then STDOUT should be:
438
+ """
439
+ name,value,expiration
440
+ foo,bar,false
441
+ foo2,bar2,95649119999
442
+ foo3,bar3,1321009871
443
+ """
444
+
445
+ When I run `wp transient list --format=csv --human-readable`
446
+ Then STDOUT should contain:
447
+ """
448
+ foo,bar,"never expires"
449
+ """
450
+ And STDOUT should contain:
451
+ """
452
+ foo3,bar3,expired
453
+ """
454
+ And STDOUT should not contain:
455
+ """
456
+ foo2,bar2,95649119999
457
+ """
458
+
459
+ When I run `wp transient list --network --format=csv`
460
+ Then STDOUT should be:
461
+ """
462
+ name,value,expiration
463
+ foo4,bar4,false
464
+ foo5,bar5,95649119999
465
+ foo6,bar6,1321009871
466
+ """
467
+
468
+ Scenario : List transients with search and exclude pattern
469
+ Given a WP install
470
+ And I run `wp transient set foo bar`
471
+ And I run `wp transient set foo2 bar2`
472
+ And I run `wp transient set foo3 bar3`
473
+ And I run `wp transient set foo4 bar4 --network`
474
+ And I run `wp transient set foo5 bar5 --network`
475
+
476
+ When I run `wp transient list --format=csv --fields=name --search="foo" `
477
+ Then STDOUT should be:
478
+ """
479
+ name
480
+ foo
481
+ """
482
+
483
+ When I run `wp transient list --format=csv --fields=name --search="foo*" `
484
+ Then STDOUT should be:
485
+ """
486
+ name
487
+ foo
488
+ foo2
489
+ foo3
490
+ """
491
+
492
+ When I run `wp transient list --format=csv --fields=name --search="*oo" `
493
+ Then STDOUT should be:
494
+ """
495
+ name
496
+ foo
497
+ """
498
+
499
+ When I run `wp transient list --format=csv --fields=name --search="*oo*" `
500
+ Then STDOUT should be:
501
+ """
502
+ name
503
+ foo
504
+ foo2
505
+ foo3
506
+ """
507
+
508
+ When I run `wp transient list --format=csv --fields=name --search="*oo?" `
509
+ Then STDOUT should be:
510
+ """
511
+ name
512
+ foo2
513
+ foo3
514
+ """
515
+
516
+ When I run `wp transient list --format=csv --fields=name --search="foo?" `
517
+ Then STDOUT should be:
518
+ """
519
+ name
520
+ foo2
521
+ foo3
522
+ """
523
+
524
+ When I run `wp transient list --format=csv --fields=name --search="doesnotexist*" `
525
+ Then STDOUT should be:
526
+ """
527
+ name
528
+ """
529
+
530
+ When I run `wp transient list --format=csv --fields=name --search="foo*" --exclude="foo2" `
531
+ Then STDOUT should be:
532
+ """
533
+ name
534
+ foo
535
+ foo3
536
+ """
537
+
538
+ When I run `wp transient list --format=csv --fields=name --search="foo*" --exclude="*3" `
539
+ Then STDOUT should be:
540
+ """
541
+ name
542
+ foo
543
+ foo2
544
+ """
545
+
546
+ When I run `wp transient list --format=csv --fields=name --search="foo*" --exclude="foo?" `
547
+ Then STDOUT should be:
548
+ """
549
+ name
550
+ foo
551
+ """
552
+
553
+ When I run `wp transient list --format=csv --fields=name --search="foo*" --network`
554
+ Then STDOUT should be:
555
+ """
556
+ name
557
+ foo4
558
+ foo5
559
+ """
560
+
561
+ When I run `wp transient list --format=csv --fields=name --search="foo*" --exclude="foo5" --network`
562
+ Then STDOUT should be:
563
+ """
564
+ name
565
+ foo4
566
+ """
0 commit comments